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

Replace black with ruff and add pre-commit #110

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

davidwilby
Copy link
Collaborator

Hey @tom-andersson et al - just a maintenance-related PR for your perusal, feel free to reject if this isn't your thing.

What this PR does

  • resolves Potential new feature: ruff linting #109
  • replaces black with ruff as the linter of choice, partially because of extra features such as linting docstrings in google-style (which black may do as well, but I haven't been able to find it)
  • adds pre-commit and a pre-commit config to run the ruff linter and formatter on a pre-commit hook.
  • adds info to CONTRIBUTING.md detailing the use of these tools.

What this PR doesn't do

  • actually formatting the codebase with ruff so far in this branch to avoid the massive diff
  • add a pull request template to remind contributors to follow these steps (that will follow in another PR)

At the moment the CI check fails since ruff is checking all the docstrings, we may be able to soften the docstring rules (configured in pyproject.toml) to something we agree with (e.g. I don't necessarily think that every module needs a docstring)

FYI @nilsleh

Copy link
Collaborator

@kallewesterling kallewesterling left a comment

Choose a reason for hiding this comment

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

LGTM!

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.

Potential new feature: ruff linting
2 participants