Skip to content

chore: Add ruff dependency and configuration#36

Merged
jsstevenson merged 8 commits into
biocommons:mainfrom
ecalifornica:3-add-ruff-linter
Jun 5, 2024
Merged

chore: Add ruff dependency and configuration#36
jsstevenson merged 8 commits into
biocommons:mainfrom
ecalifornica:3-add-ruff-linter

Conversation

@ecalifornica

@ecalifornica ecalifornica commented Oct 16, 2023

Copy link
Copy Markdown
Member

edited description by @jsstevenson:

close #3

  • Add Ruff formatting and linting. Remove flake8, isort, black, pylint, bandit -- Ruff can cover these bases pretty well.
  • Update pre-commit hooks to perform checks for both Ruff linting and formatting
  • Update cqa makefile target to do the same (just check), and reformat target to actually format.

Specific rule groupings selected (note that many specific rules also include auto-fixability -- so while they're nitpicky, they're also self-executing):

@ecalifornica
ecalifornica requested a review from reece as a code owner October 16, 2023 02:18
@codecov

codecov Bot commented Oct 16, 2023

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (9aa8d98) to head (5078419).
Report is 31 commits behind head on main.

Current head 5078419 differs from pull request most recent head cd9e9e6

Please upload reports for the commit cd9e9e6 to get more accurate results.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #36   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         2           
  Lines           18        18           
=========================================
  Hits            18        18           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions

Copy link
Copy Markdown

This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions Bot added the stale Issue is stale and subject to automatic closing label Nov 16, 2023
@github-actions

Copy link
Copy Markdown

This PR was closed because it has been stalled for 7 days with no activity.

@github-actions github-actions Bot closed this Nov 24, 2023
@reece reece reopened this Feb 19, 2024
@reece
reece requested a review from a team as a code owner February 19, 2024 03:53
@reece reece removed the stale Issue is stale and subject to automatic closing label Feb 19, 2024
@reece

reece commented Feb 19, 2024

Copy link
Copy Markdown
Member

This issue was closed by stalebot. It has been reopened to give more time for community review. See biocommons coding guidelines for stale issue and pull request policies. This resurrection is expected to be a onos.environ["GITHUB_TOKEN"]e-time event.

@github-actions

Copy link
Copy Markdown

This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions Bot added stale Issue is stale and subject to automatic closing and removed stale Issue is stale and subject to automatic closing labels Mar 21, 2024
@jsstevenson

Copy link
Copy Markdown
Contributor

I'd add one thought here, in addition to my comment in #3 : Ruff development moves very quickly, and new rules are opted-in by default, which can cause headaches in CI (eg an aesthetic change like touching up the docs can fail because new code checks have been introduced). For this reason, we pin an exact Ruff version and have a policy of revisiting it about every 6 months.

@jsstevenson jsstevenson mentioned this pull request Mar 26, 2024
@github-actions

Copy link
Copy Markdown

This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions Bot added the stale Issue is stale and subject to automatic closing label Apr 26, 2024
@github-actions

github-actions Bot commented May 3, 2024

Copy link
Copy Markdown

This PR was closed because it has been stalled for 7 days with no activity.

@jsstevenson

Copy link
Copy Markdown
Contributor

There's some room for discussion about particular Ruff rules/configs. Experimentally, I think PTH (here) will take the most work to implement, although I think it's worth it in the long run.

Note: I'm not totally sure how to handle testing of the boilerplate code contained here -- I noqa'd it for now?

@github-actions github-actions Bot removed the stale Issue is stale and subject to automatic closing label May 21, 2024
Comment thread pyproject.toml Outdated
Comment thread pyproject.toml
Comment thread pyproject.toml
@jsstevenson

Copy link
Copy Markdown
Contributor

Other notes: I've left off two linting groups, flake8-annotations and flake8-pydocstyle because I think they'd be a big lift to achieve compliance with. Worth eventually implementing IMO.

@jsstevenson
jsstevenson requested a review from korikuzma May 21, 2024 18:09
@korikuzma

Copy link
Copy Markdown
Contributor

@biocommons/maintainers did anyone else want to review this before it gets merged in?

@jsstevenson
jsstevenson merged commit 9a7060f into biocommons:main Jun 5, 2024
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.

add ruff support

5 participants