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

Ensure Ruff formatting errors are picked up in CI #22

Merged
merged 2 commits into from
May 8, 2024
Merged

Conversation

codeinthehole
Copy link
Contributor

No description provided.

There were a few errors that had slipped in as CI is not failing on them
(yet).
The command was missing the `--check` flag.
@codeinthehole codeinthehole requested a review from meshy May 8, 2024 09:36
Copy link
Contributor

@meshy meshy left a comment

Choose a reason for hiding this comment

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

Thank you!

@@ -69,8 +69,6 @@ Run all static analysis tools with:
make lint
```

This may make changes to the local files if improvements are available.
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh hang on -- Does this mean the linter will not change any code locally?

Perhaps we should introduce pre-commit to do that instead?

Copy link

Choose a reason for hiding this comment

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

or keep pre-commit optional and have a separate format-ci command

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need to decide if make lint checks formatting or applies formatting - it can't do both. We need the former in CI so I recommend that.

For local formatting, I would recommend both pre-commit and advising people to set-up ruff in their editors.

Copy link
Contributor

Choose a reason for hiding this comment

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

it can't do both

It can. using pre-commit would allow us to have it make changes and return non-0 if changes were made.

This has the benefit of being able to then show the changes in the CI output if we want

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, if you can solve the problem by running pre-commit then that's great.

Will merge this for now to solve the immediate problem.

@codeinthehole codeinthehole merged commit 84a6175 into main May 8, 2024
9 checks passed
@codeinthehole codeinthehole deleted the snagging branch May 8, 2024 12:16
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.

4 participants