diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 957bd98..5997d97 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -5,37 +5,18 @@ 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 + - name: Analysing the code with ruff 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 - run: | - python -m compileall podman_compose.py - pylint podman_compose.py - # pylint $(git ls-files '*.py') + pip install -r test-requirements.txt + ruff format --check diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..b6a8360 --- /dev/null +++ b/pyproject.toml @@ -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" diff --git a/setup.py b/setup.py index 4994d33..957f248 100644 --- a/setup.py +++ b/setup.py @@ -39,15 +39,7 @@ setup( "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', diff --git a/test-requirements.txt b/test-requirements.txt index 2ed336d..51af4dc 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -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. @@ -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