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

feat: LSDV-5496: Add Ruff linter #4660

Merged
merged 33 commits into from
Sep 7, 2023
Merged

feat: LSDV-5496: Add Ruff linter #4660

merged 33 commits into from
Sep 7, 2023

Conversation

dredivaris
Copy link
Contributor

@dredivaris dredivaris commented Aug 18, 2023

PR fulfills these requirements

  • Commit message(s) and PR title follows the format [fix|feat|ci|chore|doc]: TICKET-ID: Short description of change made ex. fix: DEV-XXXX: Removed inconsistent code usage causing intermittent errors
  • Tests for the changes have been added/updated (for bug fixes/features)
  • Docs have been added/updated (for bug fixes/features)
  • Best efforts were made to ensure docs/code are concise and coherent (checked for spelling/grammatical errors, commented out code, debug logs etc.)
  • Self-reviewed and ran all changes on a local instance (for bug fixes/features)

Change has impacts in these area(s)

(check all that apply)

  • Product design
  • Backend (Database)
  • Backend (API)
  • Frontend

Describe the reason for change

(link to issue, supportive screenshots etc.)

What does this fix?

(if this is a bug fix)

What is the new behavior?

(if this is a breaking or feature change)

What is the current behavior?

(if this is a breaking or feature change)

What libraries were added/updated?

(list all with version changes)

Does this change affect performance?

(if so describe the impacts positive or negative)

Does this change affect security?

(if so describe the impacts positive or negative)

What alternative approaches were there?

(briefly list any if applicable)

What feature flags were used to cover this change?

(briefly list any if applicable)

Does this PR introduce a breaking change?

(check only one)

  • Yes, and covered entirely by feature flag(s)
  • Yes, and covered partially by feature flag(s)
  • No
  • Not sure (briefly explain the situation below)

What level of testing was included in the change?

(check all that apply)

  • e2e
  • integration
  • unit

Which logical domain(s) does this change affect?

(for bug fixes/features, be as precise as possible. ex. Authentication, Annotation History, Review Stream etc.)

@netlify
Copy link

netlify bot commented Aug 18, 2023

Deploy Preview for heartex-docs canceled.

Name Link
🔨 Latest commit 6eac029
🔍 Latest deploy log https://app.netlify.com/sites/heartex-docs/deploys/64f8b4c68dc6dd0008e1bf9f

@netlify
Copy link

netlify bot commented Aug 18, 2023

Deploy Preview for label-studio-docs-new-theme canceled.

Name Link
🔨 Latest commit 6eac029
🔍 Latest deploy log https://app.netlify.com/sites/label-studio-docs-new-theme/deploys/64f8b4c636cec8000885a50d

@github-actions github-actions bot added the feat label Aug 18, 2023
@codecov
Copy link

codecov bot commented Aug 18, 2023

Codecov Report

Patch has no changes to coverable lines.

📢 Thoughts on this report? Let us know!.

ruff.toml Outdated Show resolved Hide resolved
Copy link
Contributor

@jombooth jombooth left a comment

Choose a reason for hiding this comment

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

Looks great overall, just a few comments that I'd like to see addressed prior to approval!

# Conflicts:
#	label_studio/core/utils/db.py
#	label_studio/tasks/functions.py
#	label_studio/tasks/models.py
#	label_studio/users/views.py
pyproject.toml Outdated Show resolved Hide resolved
Copy link
Contributor

@jombooth jombooth left a comment

Choose a reason for hiding this comment

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

# Conflicts:
#	label_studio/core/settings/base.py
#	label_studio/core/utils/io.py
#	label_studio/core/utils/params.py
@bmartel
Copy link
Contributor

bmartel commented Aug 30, 2023

Few more conflicts accrued, but I'm also seeing a single lint failure on the current diff as well. I also noticed what seemed to be a requirements issue in some of the test runs but not all? Other than that, this looks good to go.

@dredivaris dredivaris merged commit 0caeaf0 into develop Sep 7, 2023
36 of 40 checks passed
shayantabatabaee pushed a commit to shayantabatabaee/label-studio that referenced this pull request Sep 19, 2023
* feat: LSDV-5496: initial commit of default ruff autofixes and ruff configs

* Add some additional import fixes

* Add pre-commit-hook for pre-commit of ruff

* Add ruff ignores to LS

* Update ruff version and add gh action

* Add noqa as ruff linter in gh actions is having issues with this line for some reason

* Update Ruff GH action to only run on PR commits

* Add imports in LS that are needed when importing from LSE

* Add default stages to change to pre-push linting

* Remove F405 noqas - will be ignored

* Remove F405 noqas - will be ignored

* Add ignore of F405 errors in settings file, remove unused noqas

* Remove unused admin file

* Add migrations ignore

* Remove ruff changes from migrations and ignore F811 in tests

* Remove unused file

* Move to pyproject.toml

* Remove migration changes that were missed in other commit

* Import fixes after merge

* Update python version ruff assumes to 3.8

* Use underscore to allow ruff to ignore unused variable

* Update commit hook with more verbose output to devs can see when fixes are made

* Ruff import fixes

* Add pre-commit requirement

* Update with ruff autofixes

* Add ignore to get by inconsistent linting issues

* Add noqa ignore to get by inconsistent linting issues

* Loosen dateutil requirements to fix failing CI pytests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants