Skip to content

Commit

Permalink
[lint] Remove pylint and switch to ruff for Hue backend linting (clou…
Browse files Browse the repository at this point in the history
…dera#3703)

## 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: 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.
  • Loading branch information
Harshg999 authored and a.terrien committed Dec 19, 2024
1 parent 9928b8e commit 388beb4
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 523 deletions.
1 change: 0 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ commands:
- run:
name: run python lints
command: |
./build/env/bin/pip install pylint==2.5.3 pylint-django==2.3.0 configparser==5.3.0
./tools/ci/check_for_python_lint.sh
- run:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/commitflow-py3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ jobs:
- name: run python lints
run: |
./build/env/bin/pip install pylint==2.5.3 pylint-django==2.3.0 configparser==5.3.0
./tools/ci/check_for_python_lint.sh
- name: run documentation lints
Expand Down
380 changes: 0 additions & 380 deletions .pylintrc

This file was deleted.

Loading

0 comments on commit 388beb4

Please sign in to comment.