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

[lint] Remove pylint and switch to ruff for Hue backend linting #3703

Merged
merged 5 commits into from
Apr 18, 2024

Conversation

Harshg999
Copy link
Collaborator

@Harshg999 Harshg999 commented Apr 17, 2024

What changes were proposed in this pull request?

  • Current pylint setup in Hue was linting staged changes only by checking for 3 rules.
  • Also pylint is comparatively slow and GPL licensed.

  • Switching to ruff has its own perks which are mentioned on: https://docs.astral.sh/ruff/ and it's MIT licensed.
  • For starters, it's waaayyy faster, can auto-fix errors and work as both linter and formatter replacing a lot of latest packages (like a all-in-one solution).
  • It is also supporting pylint rules which is WIP: Implement Pylint astral-sh/ruff#970

  • Currently this PR only targets the minimal transition from pylint to ruff. Iteratively, we will extend the rules to improve the Hue codebase, add its pre-commit and play around auto-fixing errors capability. This will also help in making our codebase more PEP8 compliant.

Note

  • Ruff still does not support pylint's W0311(bad-indentation) rule which was present earlier with pylint in Hue. We will update it later when the support lands in a future release.

How was this patch tested?

  • Manually in local setup.

@Harshg999 Harshg999 changed the title [ruff] Introduce ruff and remove pylint from Hue [lint] Remove pylint and switch to ruff for Hue backend linting Apr 17, 2024
Copy link
Collaborator

@bjornalm bjornalm left a comment

Choose a reason for hiding this comment

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

LGTM, see comments and questions :-)

desktop/core/src/desktop/settings.py Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
tools/ci/check_for_python_lint.sh Show resolved Hide resolved
Copy link
Collaborator

@wing2fly wing2fly left a comment

Choose a reason for hiding this comment

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

Good to move to MIT kind of lib!

desktop/core/src/desktop/settings.py Show resolved Hide resolved
@Harshg999 Harshg999 enabled auto-merge (squash) April 18, 2024 09:38
@Harshg999 Harshg999 merged commit 264a267 into master Apr 18, 2024
3 of 4 checks passed
@Harshg999 Harshg999 deleted the introduce-ruff branch April 18, 2024 09:49
athithyaaselvam pushed a commit that referenced this pull request Jun 10, 2024
…inting (#3703)

- Current pylint setup in Hue was linting staged changes only by checking for 3 rules.
- Also pylint is comparatively slow and GPL licensed.

- Switching to ruff has its own perks which are mentioned on: https://docs.astral.sh/ruff/ and it's MIT licensed.
- For starters, it's waaayyy faster, can auto-fix errors and work as both linter and formatter replacing a lot of latest packages (like a all-in-one solution).
- It is also supporting pylint rules which is WIP: astral-sh/ruff#970

- Currently this PR only targets the minimal transition from pylint to ruff. Iteratively, we will extend the rules to improve the Hue codebase, add its pre-commit and play around auto-fixing errors capability. This will also help in making our codebase more PEP8 compliant.

- Ruff still does not support pylint's `W0311(bad-indentation)` rule which was present earlier with pylint in Hue. We will update it later when the support lands in a future release.

- Manually in local setup.

(cherry picked from commit 264a267)
(cherry picked from commit 8aa919d946ba8d49add26261a3789b7013ef8566)
Change-Id: Ia5388cabfea5a2fa491738e86f2ce49e3dd0fe0a
(cherry picked from commit 76e9ad2b0aab0cc7e062ef3fd9a3e4b698f7bbe9)
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.

None yet

4 participants