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

Enable explicit Ruff check rules #23741

Merged
merged 61 commits into from
Jul 9, 2024

Conversation

brettcannon
Copy link
Member

No description provided.

@brettcannon brettcannon added debt Covers everything internal: CI, testing, refactoring of the codebase, etc. area-internal Label for non-user facing issues labels Jul 3, 2024
@brettcannon brettcannon self-assigned this Jul 3, 2024
@brettcannon brettcannon changed the title Enable F, E4, E7, E9, and I in Ruff check Enable explicit Ruff check rules Jul 4, 2024
@brettcannon
Copy link
Member Author

As penance for not following PEP 8, I have selected reviewers to learn from some of the changes I made. 😉

@brettcannon brettcannon marked this pull request as ready for review July 4, 2024 22:47
@vscodenpa vscodenpa added this to the July 2024 milestone Jul 4, 2024
anthonykim1
anthonykim1 previously approved these changes Jul 9, 2024
@rafrafek
Copy link

rafrafek commented Jul 9, 2024

Great job! I copied some of the rules to my project, thank you! 🙏

I can also recommend the following ones I currently use:

select = [
    # ...
    "C90",  # mccabe
    "FIX",  # flake8-fixme
    "S",  # flake8-bandit
    # ...
]

mccabe checks complexity https://docs.astral.sh/ruff/rules/complex-structure/#complex-structure-c901 :

[tool.ruff.lint.mccabe]
max-complexity = 6

flake8-fixme looks for FIXME, TODO and other temporary developer notes.

flake8-bandit looks for security flaws.

eleanorjboyd
eleanorjboyd previously approved these changes Jul 9, 2024
Co-authored-by: Rafał <23004737+rafrafek@users.noreply.github.com>
@brettcannon brettcannon dismissed stale reviews from eleanorjboyd and anthonykim1 via d11737e July 9, 2024 18:50
@brettcannon
Copy link
Member Author

I can also recommend the following ones I currently use

Thanks for the suggestions, but I purposefully left those out as they either go against how we already do things (e.g. TODO is fine), or I find unnecessary (e.g. McCabe).

@brettcannon brettcannon merged commit 462b9bf into microsoft:main Jul 9, 2024
40 checks passed
@brettcannon brettcannon deleted the more-ruff-check branch July 9, 2024 20:01
eleanorjboyd pushed a commit to eleanorjboyd/vscode-python that referenced this pull request Jul 30, 2024
Co-authored-by: Rafał <23004737+rafrafek@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-internal Label for non-user facing issues debt Covers everything internal: CI, testing, refactoring of the codebase, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants