Skip to content

Commit

Permalink
[Feature] change linter to ruff (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
RektPunk authored Sep 11, 2024
1 parent dcfdebe commit ea798e4
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 164 deletions.
16 changes: 2 additions & 14 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,5 @@ jobs:
- name: Check out Git repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12

- name: Install Python dependencies
run: pip install black flake8

- name: Run linters
uses: wearerequired/lint-action@v2
with:
black: true
flake8: true
flake8_args: "--ignore=E266,E501,W503"
- name: Lint check ruff
uses: chartboost/ruff-action@v1
39 changes: 23 additions & 16 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-json
- repo: https://github.com/psf/black
rev: stable
hooks:
- id: black
- repo: https://github.com/pycqa/isort
rev: 5.12.0 # Use the latest version of isort
hooks:
- id: isort
args: ["--profile", "black"]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-json
- id: check-toml
- id: check-added-large-files
- id: check-merge-conflict

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.4
hooks:
- id: ruff
args: [ --fix ]
- id: ruff-format

- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
args: ["--profile", "black"]
131 changes: 1 addition & 130 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,8 @@ fastparquet = "^2024.5.0"


[tool.poetry.group.dev.dependencies]
isort = "^5.13.2"
black = "^24.8.0"
pre-commit = "^3.8.0"
pytest = "^8.3.2"
flake8 = "^7.1.1"
pytest-cov = "^5.0.0"

[tool.poetry.scripts]
Expand Down
2 changes: 1 addition & 1 deletion rektgbm/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# flake8: noqa
# ruff: noqa
from rektgbm.dataset import RektDataset
from rektgbm.gbm import RektGBM
from rektgbm.optimizer import RektOptimizer
Expand Down

0 comments on commit ea798e4

Please sign in to comment.