Skip to content

[PLT-1506] Added Ruff linting to SDK #1822

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

Merged
merged 18 commits into from
Sep 20, 2024
Merged

[PLT-1506] Added Ruff linting to SDK #1822

merged 18 commits into from
Sep 20, 2024

Conversation

Gabefire
Copy link
Collaborator

@Gabefire Gabefire commented Sep 17, 2024

Description

  • This adds in the Ruff Linter that is the same package as the Ruff formator we now use
  • if this merges SDK devs will HAVE to use Ruff for linting this is the same tool for formatting
  • Note mypy type checker is separate from this linter
  • Using default rules besides Flake which is showing 300+ violations right now mostly unused imports. I also ignore one rule for bare excepts since that is a rule we break a lot
  • View this doc for all rules

@Gabefire Gabefire requested a review from a team as a code owner September 17, 2024 15:59
@Gabefire Gabefire marked this pull request as draft September 17, 2024 15:59
@vbrodsky
Copy link
Contributor

@Gabefire is it linting? or removing ND deserialization? Or both?

Copy link
Contributor

@vbrodsky vbrodsky left a comment

Choose a reason for hiding this comment

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

Great job

Copy link
Contributor

@vbrodsky vbrodsky left a comment

Choose a reason for hiding this comment

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

Had to remove approval due to failing tests for p3.12 version

@Gabefire Gabefire added the hold do not review yet! label Sep 18, 2024
@Gabefire Gabefire changed the title Added Ruff linting to SDK [PLT-1506] Added Ruff linting to SDK Sep 18, 2024
@Gabefire Gabefire marked this pull request as ready for review September 18, 2024 02:56
@Gabefire Gabefire removed the hold do not review yet! label Sep 18, 2024
@Gabefire Gabefire marked this pull request as draft September 18, 2024 03:10
@Gabefire Gabefire marked this pull request as ready for review September 19, 2024 17:43
@@ -74,6 +74,10 @@ dev-dependencies = [
[tool.ruff]
line-length = 80

[tool.ruff.lint]
ignore = ["F", "E722"]
exclude = ["**/__init__.py"]
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This needs to be excluded for future rules (no unused imports)

@@ -74,6 +74,10 @@ dev-dependencies = [
[tool.ruff]
line-length = 80

[tool.ruff.lint]
ignore = ["F", "E722"]
Copy link
Collaborator Author

@Gabefire Gabefire Sep 19, 2024

Choose a reason for hiding this comment

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

I have PyFlake and a bareexcept rule ignored here. Later we should look at not ignoring these rules and possiblly include more then just the defaults.

rye-fmt-check = "rye fmt --check"
mypy-lint = "mypy src --pretty --show-error-codes --non-interactive --install-types"
lint = { chain = ["mypy-lint", "rye-fmt-check"] }
lint = { chain = ["rye-fmt-check", "mypy-lint", "rye-lint"] }
Copy link
Contributor

Choose a reason for hiding this comment

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

do we still need mypy here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yea I think so Mypy is a type checker

@Gabefire Gabefire merged commit b5fd958 into v6 Sep 20, 2024
20 of 26 checks passed
@Gabefire Gabefire deleted the gu/rye_lint branch September 20, 2024 00:01
vbrodsky pushed a commit that referenced this pull request Oct 11, 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.

2 participants