Conversation
34e0e4b to
5b8fde2
Compare
|
Hi @btobers @drounce, I updated this with the latest changes on
Then I applied the automatic fixes:
Ruff follows the Black code style (see https://black.readthedocs.io/en/stable/the_black_code_style/index.html) which seems to be the most popularly used one lately. Please take a look there and see if there is something which you don't like. I don't think there's anything controversial. |
|
Hi @ddundo thanks for working on this! I have no issues with the Black code style. Question: you added ruff linter instructions to the contribution guide in commit b0637f7. However, you also set up a ruff check in test_suite.yml. Would this make is so that the GitHub tests workflow would fail if ruff linter encounters an unresolved issue? In other words, we need to run |
Yup, that's right.
Good point, added in 75fc63e.
This is possible, but if we wanted this to be run automatically I'd prefer to add a pre-commit hook. I actually added this but then dropped it (see 0210aa1 on how it looks). What this does is automatically run the linter and formatter when we try to commit. The commit will fail if issues are detected. I personally like this approach, but some dislike it because they feel like it interferes with their work too much. And since we have these checks being run as part of the test suite, these issues will anyway need to be resolved before merging. But this leaves it to the developer to decide at what point to address it, rather than being forced to address it every time they try to commit. |
|
That makes sense, and I can see the argument for not automatically fixing issues with a pre-commit hook. Thanks! |
|
My preference would be for single quotes. I don't see the ability to review this, so will circle back, but based on your stated summary this seems like a good path forward. |
|
Thanks both! I changed to single quotes in d043d47, which involved setting in pyproject.toml. And sorry, I just realised I didn't request reviews earlier. |
Co-authored-by: Brandon S. Tober <tobers.brandon@gmail.com>
|
Thanks @btobers! I committed your suggestions and will go ahead and merge. |
Closes #54. This PR introduces the [Ruff](https://github.com/astral-sh/ruff) linter and formatter to check for errors and stylistic issues, including the pre-commit hook. Relevant changes are done in `pyproject.toml` and `test_suite.yml`. The rest of changes are due to applying the fixes. A few things to note: - I updated contribution guidelines - I added the ruff linting and formatting checks to the `test_suite.yml` workflow - The maximum line length is set to 88 by default, which we can change if you'd prefer - At the moment I ignored quite a few errors that couldn't be fixed automatically (see the `ignore` list in `pyproject.toml`) - I'll open a separate issue to address these. **Edit: opened #68** - I added `sample_data/` to `.gitignore`
Closes #54.
This PR introduces the Ruff linter and formatter to check for errors and stylistic issues, including the pre-commit hook. Relevant changes are done in
pyproject.tomlandtest_suite.yml. The rest of changes are due to applying the fixes.A few things to note:
test_suite.ymlworkflowignorelist inpyproject.toml) - I'll open a separate issue to address these. Edit: opened Fix the rest of linting rules #68sample_data/to.gitignore