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

Ruff & mypy linting rules. #9

Merged
merged 1 commit into from
Mar 10, 2025
Merged

Ruff & mypy linting rules. #9

merged 1 commit into from
Mar 10, 2025

Conversation

willGraham01
Copy link
Collaborator

Adds additional rules to the ignore list as per internal Slack suggestions:

  • D105 missing docstrings on magic (dunder) methods - can potentially see the value in having such docstrings in some cases but don't think it should be required as typically their behaviour is obvious and function signature (and so interpretation of arguments) fixed by interface they are implementing
  • ANN in tests
  • D rules in tests

Also have added exclude = ["tests"] to the tool.mypy config section in the pyproject.toml, for the same reasons as ANN has been ignored.

@willGraham01
Copy link
Collaborator Author

Am not sure why pre-commit has decided to compactify the lines in pyproject.toml, hence why this "looks" like a negative PR.

Copy link
Collaborator

@matt-graham matt-graham 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. Also not sure what is going on with the reformatting - I think it's probably the hook for prettier causing the reformatting but why it's suddenly decided to do this I don't know as I've more often had it reformat lists in the opposite more verbose direction. If causes issues / starts flip flopping recommended reformatting changes we can review it's configuration.

@mscroggs mscroggs merged commit e0c56c2 into main Mar 10, 2025
5 checks passed
@mscroggs mscroggs deleted the linting-rules branch March 10, 2025 09:18
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.

None yet

3 participants