-
Notifications
You must be signed in to change notification settings - Fork 252
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
make .pre-commit-config.yaml similar to poetry repo #271
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,81 @@ | ||
exclude: | | ||
(?x)( | ||
^tests/.*/fixtures/.* | ||
| ^src/poetry/core/_vendor | ||
) | ||
|
||
repos: | ||
- repo: https://github.com/psf/black | ||
rev: 21.9b0 | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.1.0 | ||
hooks: | ||
- id: black | ||
exclude: ^src/poetry/core/_vendor | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: debug-statements | ||
- id: check-merge-conflict | ||
- id: check-case-conflict | ||
- id: check-json | ||
- id: check-toml | ||
- id: check-yaml | ||
- id: pretty-format-json | ||
args: | ||
- --autofix | ||
- --no-ensure-ascii | ||
- --no-sort-keys | ||
- id: check-ast | ||
- id: debug-statements | ||
- id: check-docstring-first | ||
|
||
- repo: https://gitlab.com/pycqa/flake8 | ||
rev: 3.9.2 | ||
- repo: https://github.com/pre-commit/pygrep-hooks | ||
rev: v1.9.0 | ||
hooks: | ||
- id: flake8 | ||
additional_dependencies: | ||
- flake8-annotations | ||
- flake8-bugbear | ||
- flake8-comprehensions | ||
- flake8-eradicate | ||
- flake8-simplify | ||
- flake8-tidy-imports | ||
- flake8-use-fstring | ||
- id: python-check-mock-methods | ||
- id: python-use-type-annotations | ||
- id: python-check-blanket-type-ignore | ||
- id: python-check-blanket-noqa | ||
|
||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v0.910 | ||
- repo: https://github.com/asottile/yesqa | ||
rev: v1.3.0 | ||
hooks: | ||
- id: mypy | ||
pass_filenames: false | ||
- id: yesqa | ||
additional_dependencies: &flake8_deps | ||
- flake8-annotations==2.7.0 | ||
- flake8-bugbear==22.1.11 | ||
- flake8-comprehensions==3.8.0 | ||
- flake8-eradicate==1.2.0 | ||
- flake8-simplify==0.15.1 | ||
- flake8-tidy-imports==4.6.0 | ||
- flake8-use-fstring==1.3 | ||
|
||
- repo: https://github.com/asottile/pyupgrade | ||
rev: v2.31.0 | ||
hooks: | ||
- id: pyupgrade | ||
args: | ||
- --py36-plus | ||
|
||
- repo: https://github.com/pycqa/isort | ||
rev: 5.9.3 | ||
rev: 5.10.1 | ||
hooks: | ||
- id: isort | ||
additional_dependencies: [toml] | ||
exclude: | | ||
(?x)( | ||
^.*/?setup\.py$ | ||
| ^src/poetry/core/_vendor | ||
| tests/.*\.pyi$ | ||
) | ||
|
||
- repo: https://github.com/asottile/pyupgrade | ||
rev: v2.29.1 | ||
- repo: https://github.com/psf/black | ||
rev: 21.12b0 | ||
hooks: | ||
- id: pyupgrade | ||
args: | ||
- --py36-plus | ||
exclude: ^src/poetry/core/_vendor | ||
- id: black | ||
|
||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.0.1 | ||
- repo: https://github.com/pycqa/flake8 | ||
rev: 4.0.1 | ||
hooks: | ||
- id: trailing-whitespace | ||
exclude: | | ||
(?x)( | ||
^tests/.*/fixtures/.* | ||
| ^src/poetry/core/_vendor | ||
) | ||
- id: end-of-file-fixer | ||
exclude: | | ||
(?x)( | ||
^tests/.*/fixtures/.* | ||
| ^src/poetry/core/_vendor | ||
) | ||
- id: debug-statements | ||
exclude: ^src/poetry/core/_vendor | ||
|
||
- id: check-json | ||
exclude: ^src/poetry/core/_vendor | ||
- id: flake8 | ||
additional_dependencies: *flake8_deps | ||
|
||
- id: pretty-format-json | ||
exclude: ^src/poetry/core/_vendor | ||
args: | ||
- --no-sort-keys | ||
- --autofix | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v0.931 | ||
hooks: | ||
- id: mypy | ||
pass_filenames: false |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ | |
try: | ||
FileNotFoundError | ||
except NameError: | ||
FileNotFoundError = IOError # noqa | ||
FileNotFoundError = IOError | ||
Comment on lines
12
to
+15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto here - can we use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ping @tony There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In #263 I pushed a change removing this |
||
|
||
|
||
def list_to_shell_command(cmd: List[str]) -> str: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is python
<3.3
compat still required here?if we need it, we should use
or similar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would try to avoid logic change to the code within this PR, because its only about formatting. I think this is better handled in #263 for example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ping @tony
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think
try
/catch
still makes sense here. It's true was originally an underlying version constraint.lzma
is optionally built in. You can compile CPython without lzmaCould not figure out the flags, Not having the library seems to do it:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that makes sense