Skip to content

Commit

Permalink
CDPD-69232: [lint] Remove pylint and switch to ruff for Hue backend l…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
Harshg999 authored and wing2fly committed Apr 29, 2024
1 parent 4604e76 commit ce88ac8
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 522 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 ce88ac8

Please sign in to comment.