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

Use only ruff for Python linting and formatting #1202

Merged
merged 4 commits into from
Nov 15, 2023
Merged

Use only ruff for Python linting and formatting #1202

merged 4 commits into from
Nov 15, 2023

Conversation

taldcroft
Copy link
Member

@taldcroft taldcroft commented Nov 11, 2023

Description

This updates the template files to match what was successfully used in sot/kadi#268.

One slight departure from the "ruff-only" theme is moving the pyright configuration into its dedicated JSON file. There is a question about whether it is better to glop all tool config into one pyproject.toml file or use separate config files where possible. For this application where we want to apply the same files to many projects, I believe that having separate config files works better. If we want to apply a mass update then it is just a matter of copying a new file (e.g. ruff.toml) instead of editing a section in pyproject.toml.

Testing

The files were successfully used in sot/kadi#268, including inadvertent lint/format mistakes that ended up triggering pre-commit and GitHub action failures (both format and lint for each case).

I also confirmed that the new pyrightconfig.json file successfully forces pyright in VS code to ignore notebooks. Without that file I see spurious pyright errors in the notebook (e.g. "Unresolved import" for cxotime which is clearly wrong).

@taldcroft taldcroft mentioned this pull request Nov 13, 2023
2 tasks
@taldcroft taldcroft merged commit 02a298f into master Nov 15, 2023
@taldcroft taldcroft deleted the ruff-only branch November 15, 2023 20:04
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.

3 participants