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 #470

Merged
merged 3 commits into from
May 2, 2024
Merged

Replace black with ruff #470

merged 3 commits into from
May 2, 2024

Conversation

callumforrester
Copy link
Contributor

@callumforrester callumforrester commented Apr 25, 2024

Closes #311

CI was starting to fail due to minor disagreements between black and ruff. This PR switches to the ruff formatter as standard like the copier template: https://github.com/DiamondLightSource/python-copier-template/blob/main/.pre-commit-config.yaml

Instructions to reviewer on how to test:

  1. Ensure CI passes
  2. Optional: rebase into Port UndulatorDCM to ophyd-async #461 and see if it fixes CI

Checks for reviewer

  • Would the PR title make sense to a scientist on a set of release notes
  • If a new device has been added does it follow the standards

Copy link
Contributor

@DominicOram DominicOram left a comment

Choose a reason for hiding this comment

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

This is fine by me, just a few places you missed. Some docs mention black:

Comment on lines -27 to -34
# Re-enable after https://github.com/DiamondLightSource/dodal/issues/311
# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: v1.7.1
# hooks:
# - id: mypy
# files: 'src/.*\.py$'
# additional_dependencies: [types-requests, pydantic]
# args: ["--ignore-missing-imports", "--show-traceback", "--no-strict-optional"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Should: If we're going to remove this can we close #311?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, in the template typing is not handled in precommit, you do it with tox -e type-checking (in dodal it is currently tox -e mypy), which also runs in CI. Will add a closes.

@DominicOram DominicOram mentioned this pull request Apr 30, 2024
2 tasks
Copy link
Contributor

@DominicOram DominicOram left a comment

Choose a reason for hiding this comment

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

Great, thank you!

@DominicOram DominicOram merged commit 6ebb9fa into main May 2, 2024
11 checks passed
@DominicOram DominicOram deleted the remove-black branch May 2, 2024 11:45
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.

Mypy precommit hook failing in CI
2 participants