Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove pycodestyle, add black, add numerous pre-commit checks. #115

Merged
merged 4 commits into from
Jan 3, 2023

Conversation

htorianik
Copy link
Contributor

Add pre-commit as a replacement for tox linting:

  • trailing-whitespace
  • end-of-line-fixer
  • check-added-large-files
  • no-commit-to-branch
  • yamllint
  • yamlfmt
  • mdformat (as a replace for remark)
  • black (as a replace to pycodestyle)
  • mypy
  • pylint

@htorianik htorianik requested a review from a team January 3, 2023 14:22
@@ -6,8 +6,10 @@

from lark.visitors import Transformer, Discard, _DiscardType

HEREDOC_PATTERN = re.compile(r'<<([a-zA-Z][a-zA-Z0-9._-]+)\n((.|\n)*?)\n\s*\1', re.S)
HEREDOC_TRIM_PATTERN = re.compile(r'<<-([a-zA-Z][a-zA-Z0-9._-]+)\n((.|\n)*?)\n\s*\1', re.S)
HEREDOC_PATTERN = re.compile(r"<<([a-zA-Z][a-zA-Z0-9._-]+)\n((.|\n)*?)\n\s*\1", re.S)

Check failure

Code scanning / CodeQL

Inefficient regular expression

This part of the regular expression may cause exponential backtracking on strings starting with '<<A-\n' and containing many repetitions of '\n'.
HEREDOC_TRIM_PATTERN = re.compile(r'<<-([a-zA-Z][a-zA-Z0-9._-]+)\n((.|\n)*?)\n\s*\1', re.S)
HEREDOC_PATTERN = re.compile(r"<<([a-zA-Z][a-zA-Z0-9._-]+)\n((.|\n)*?)\n\s*\1", re.S)
HEREDOC_TRIM_PATTERN = re.compile(
r"<<-([a-zA-Z][a-zA-Z0-9._-]+)\n((.|\n)*?)\n\s*\1", re.S

Check failure

Code scanning / CodeQL

Inefficient regular expression

This part of the regular expression may cause exponential backtracking on strings starting with '<<-A-\n' and containing many repetitions of '\n'.
.github/workflows/test.yml Outdated Show resolved Hide resolved
README.md Outdated
2. Create a pull request. Explain why you want to make the change and what it’s for.

1. For any sizable change, first open a GitHub issue to discuss your idea.
1. Create a pull request. Explain why you want to make the change and what it’s for.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. Create a pull request. Explain why you want to make the change and what it’s for.
2. Create a pull request. Explain why you want to make the change and what it’s for.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix it in a different way. Changed it to unordered list, because mdformat fails on this case.

@rddimon rddimon linked an issue Jan 3, 2023 that may be closed by this pull request
@htorianik htorianik merged commit b3e81a9 into master Jan 3, 2023
@htorianik htorianik deleted the AT-8092-code-style-updates branch January 3, 2023 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

blacken the code base
3 participants