Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Merged
htorianik merged 4 commits into
masterfrom
AT-8092-code-style-updates
Jan 3, 2023
Merged

Remove pycodestyle, add black, add numerous pre-commit checks.#115
htorianik merged 4 commits into
masterfrom
AT-8092-code-style-updates

Conversation

@htorianik

Copy link
Copy Markdown
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
Comment thread hcl2/transformer.py

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'.
Comment thread hcl2/transformer.py
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'.
Comment thread .github/workflows/test.yml
Comment thread 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
Copy Markdown
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
Copy Markdown
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

4 participants