Skip to content

Commit

Permalink
Replace flake8, black, pylint with ruff
Browse files Browse the repository at this point in the history
For now pylint checks are disabled.

Signed-off-by: Povilas Kanapickas <[email protected]>
  • Loading branch information
p12tic committed Mar 7, 2024
1 parent e66016b commit 63f6301
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 43 deletions.
32 changes: 6 additions & 26 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,17 @@ on:
- pull_request

jobs:
lint-black:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install psf/black requirements
run: |
sudo apt-get update
sudo apt-get install -y python3 python3-venv
- uses: psf/black@stable
with:
options: "--check --verbose"
version: "~= 23.3"

lint-pylint:
lint-ruff:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.11"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- uses: actions/checkout@v3
name: Set up Python ${{ matrix.python-version }}
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install pylint
- name: Analysing the code with pylint
- name: Analysing the code with ruff
run: |
python -m compileall podman_compose.py
pylint podman_compose.py
# pylint $(git ls-files '*.py')
ruff format --check
15 changes: 15 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[tool.ruff]
line-length = 100
target-version = "py38"

[tool.ruff.lint]
select = ["W", "E", "F", "I"]
ignore = [
]

[tool.ruff.lint.isort]
force-single-line = true

[tool.ruff.format]
preview = true # needed for quote-style
quote-style = "preserve"
10 changes: 1 addition & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,7 @@
"pyyaml",
"python-dotenv",
],
extras_require={
"devel": [
"flake8",
"black",
"pylint",
"pre-commit",
"coverage"
]
}
extras_require={"devel": ["ruff", "pre-commit", "coverage"]},
# test_suite='tests',
# tests_require=[
# 'coverage',
Expand Down
9 changes: 1 addition & 8 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
coverage==7.4.3
pytest==8.0.2
tox==4.13.0
black==24.2.0
flake8==7.0.0
ruff==0.3.1

# The packages below are transitive dependencies of the packages above and are included here
# to make testing reproducible.
Expand All @@ -13,19 +12,13 @@ flake8==7.0.0

cachetools==5.3.3
chardet==5.2.0
click==8.1.7
colorama==0.4.6
distlib==0.3.8
filelock==3.13.1
iniconfig==2.0.0
mccabe==0.7.0
mypy-extensions==1.0.0
packaging==23.2
pathspec==0.12.1
platformdirs==4.2.0
pluggy==1.4.0
pycodestyle==2.11.1
pyflakes==3.2.0
pyproject-api==1.6.1
python-dotenv==1.0.1
PyYAML==6.0.1
Expand Down

0 comments on commit 63f6301

Please sign in to comment.