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

style: add pre-commit, typos and ruff, fix several #64

Merged
merged 11 commits into from
Dec 7, 2023
Merged

style: add pre-commit, typos and ruff, fix several #64

merged 11 commits into from
Dec 7, 2023

Conversation

qartik
Copy link
Member

@qartik qartik commented Dec 5, 2023

  • add pre-commit with several checks
  • add ruff.toml with some sane lints, with some disabled
  • add MANIFEST.in
  • update requirements.txt

Fixes #63

@qartik qartik requested a review from mark-koch December 5, 2023 18:16
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: mixed-line-ending
# - id: trailing-whitespace
Copy link
Member Author

Choose a reason for hiding this comment

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

Doesn't work well with .err files.

.pre-commit-config.yaml Outdated Show resolved Hide resolved
.pre-commit-config.yaml Outdated Show resolved Hide resolved
MANIFEST.in Outdated Show resolved Hide resolved
ignore = [
"COM812", "ISC001", # conflicting with the formatter
"S101", # Use of `assert` detected
"B905", # `zip()` without an explicit `strict=` parameter
Copy link
Member Author

Choose a reason for hiding this comment

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

This last lint could probably be fixed and removed from ignore. I didn't want to assume.

Copy link
Collaborator

Choose a reason for hiding this comment

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

From memory it should be fine to add strict=True to every zip, but should check to make sure. I added an issue #65 for this

"T10", # flake8-debugger
"T20", # flake8-print
"TCH", # flake8-type-checking
# "TD", # flake8-todos
Copy link
Member Author

Choose a reason for hiding this comment

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

Many of these commented out lints can be enabled if desired.

@qartik qartik changed the title style: add pre-commit, typos and ruff, fix some style: add pre-commit, typos and ruff, fix several Dec 5, 2023
.pre-commit-config.yaml Outdated Show resolved Hide resolved
.pre-commit-config.yaml Outdated Show resolved Hide resolved
MANIFEST.in Outdated Show resolved Hide resolved
guppy/ast_util.py Outdated Show resolved Hide resolved
guppy/checker/cfg_checker.py Outdated Show resolved Hide resolved
guppy/compiler/cfg_compiler.py Show resolved Hide resolved
ignore = [
"COM812", "ISC001", # conflicting with the formatter
"S101", # Use of `assert` detected
"B905", # `zip()` without an explicit `strict=` parameter
Copy link
Collaborator

Choose a reason for hiding this comment

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

From memory it should be fine to add strict=True to every zip, but should check to make sure. I added an issue #65 for this

Copy link
Collaborator

@mark-koch mark-koch left a comment

Choose a reason for hiding this comment

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

Looks good to me, thank you! Feel free to merge

@qartik qartik merged commit e68c497 into main Dec 7, 2023
1 check passed
@qartik qartik deleted the linters branch December 7, 2023 16:42
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.

Use Python 3.10 style unions
2 participants