Skip to content

Commit

Permalink
use ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamBergamin committed May 29, 2024
1 parent e2481a5 commit 8ab145d
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 17 deletions.
2 changes: 0 additions & 2 deletions .flake8

This file was deleted.

8 changes: 4 additions & 4 deletions .github/workflows/flake8.yml → .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Linting validation using flake8
name: Linting validation using ruff

on:
push:
branches: [main]
pull_request:

jobs:
build:
lint:
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
Expand All @@ -23,6 +23,6 @@ jobs:
run: |
pip install -U pip
pip install -r requirements.txt
- name: Lint with flake8
- name: Lint with ruff
run: |
flake8 *.py
ruff check
2 changes: 1 addition & 1 deletion .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
pull_request:

jobs:
build:
test:
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,12 @@ To stop running locally, press `<CTRL> + C` to end the process.
#### Linting

```zsh
# Run flake8 from root directory for linting
flake8 *.py
# Run ruff from root directory for linting
ruff check

# Run black from root directory for code formatting
black .
# Run ruff from root directory for code formatting
ruff format
ruff check --fix
```

## Testing
Expand Down
17 changes: 14 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
# black project prefers pyproject.toml
# that's why we have this file in addition to other setting files
[tool.black]
[tool.ruff]
line-length = 125

[tool.ruff.lint]
ignore = []
select = [
# pycodestyle error
"E",
# pycodestyle warning
"W",
# Pyflakes
"F",
# isort
"I",
]

[tool.pytest.ini_options]
testpaths = ["tests"]
log_file = "logs/pytest.log"
Expand Down
5 changes: 2 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
slack-cli-hooks
slack-bolt==1.19.0rc1
pytest==8.2
flake8==7.0
black==24.4
requests==2.32
Flask==3.0
pytest==8.2
ruff==0.4

0 comments on commit 8ab145d

Please sign in to comment.