diff --git a/.github/ISSUE_TEMPLATE/Bug.yaml b/.github/ISSUE_TEMPLATE/Bug.yaml index 39088a600..3adc5d4ed 100644 --- a/.github/ISSUE_TEMPLATE/Bug.yaml +++ b/.github/ISSUE_TEMPLATE/Bug.yaml @@ -13,7 +13,6 @@ body: Please consider supporting our collective: 👉 https://opencollective.com/wemake-python-styleguide/donate - - type: textarea attributes: label: "What's wrong" @@ -26,7 +25,6 @@ body: description: "Please, explain how do you expect it to be" validations: required: True - - type: textarea attributes: label: "Flake8 version and plugins" diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 909a6a923..3286debbf 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,20 +1,20 @@ version: 2 updates: -- package-ecosystem: pip - directory: "/" - schedule: - interval: daily - time: "02:00" - open-pull-requests-limit: 10 -- package-ecosystem: github-actions - directory: "/" - schedule: - interval: daily - time: "02:00" - open-pull-requests-limit: 10 -- package-ecosystem: docker - directory: "/" - schedule: - interval: daily - time: "02:00" - open-pull-requests-limit: 10 + - package-ecosystem: pip + directory: "/" + schedule: + interval: daily + time: "02:00" + open-pull-requests-limit: 10 + - package-ecosystem: github-actions + directory: "/" + schedule: + interval: daily + time: "02:00" + open-pull-requests-limit: 10 + - package-ecosystem: docker + directory: "/" + schedule: + interval: daily + time: "02:00" + open-pull-requests-limit: 10 diff --git a/.github/workflows/depup.yml b/.github/workflows/depup.yml index b7c87a01e..d0e0545d1 100644 --- a/.github/workflows/depup.yml +++ b/.github/workflows/depup.yml @@ -1,18 +1,14 @@ name: depup - 'on': workflow_dispatch: schedule: - cron: '30 7 * * *' - concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true - permissions: contents: write pull-requests: write - jobs: reviewdog: runs-on: ubuntu-latest @@ -24,7 +20,6 @@ jobs: file: Dockerfile version_name: REVIEWDOG_VERSION repo: reviewdog/reviewdog - - name: Create Pull Request to update reviewdog uses: peter-evans/create-pull-request@v7 with: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f4fbb2380..565308c89 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,19 +1,15 @@ name: test - 'on': push: branches: - master pull_request: workflow_dispatch: - concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true - permissions: contents: read - jobs: build: runs-on: ubuntu-latest @@ -21,32 +17,27 @@ jobs: fail-fast: false matrix: python-version: ['3.10', '3.11', '3.12', '3.13'] - steps: - - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Install poetry - run: | - curl -sSL "https://install.python-poetry.org" | python - - # Adding `poetry` to `$PATH`: - echo "$HOME/.poetry/bin" >> $GITHUB_PATH - - - name: Install dependencies - run: | - poetry config virtualenvs.in-project true - poetry run pip install -U pip - poetry install - - - name: Run tests - run: make test - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v5 - with: - files: ./coverage.xml - token: ${{ secrets.CODECOV_TOKEN }} + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - name: Install poetry + run: | + curl -sSL "https://install.python-poetry.org" | python + + # Adding `poetry` to `$PATH`: + echo "$HOME/.poetry/bin" >> $GITHUB_PATH + - name: Install dependencies + run: | + poetry config virtualenvs.in-project true + poetry run pip install -U pip + poetry install + - name: Run tests + run: make test + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v5 + with: + files: ./coverage.xml + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/wps.yml b/.github/workflows/wps.yml index 641dbec09..a396a3f7e 100644 --- a/.github/workflows/wps.yml +++ b/.github/workflows/wps.yml @@ -1,26 +1,22 @@ name: wps - 'on': pull_request: branches: - master - concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true - permissions: contents: read pull-requests: write - jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: wemake-services/wemake-python-styleguide@master - with: - reporter: 'github-pr-review' - fail_workflow: false - env: - GITHUB_TOKEN: ${{ secrets.github_token }} + - uses: actions/checkout@v4 + - uses: wemake-services/wemake-python-styleguide@master + with: + reporter: 'github-pr-review' + fail_workflow: false + env: + GITHUB_TOKEN: ${{ secrets.github_token }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0cc22fe38..37e264664 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,6 +10,10 @@ repos: - id: mixed-line-ending args: [--fix=lf] - id: check-case-conflict + - repo: https://github.com/google/yamlfmt + rev: v0.14.0 + hooks: + - id: yamlfmt - repo: https://github.com/python-jsonschema/check-jsonschema rev: 0.30.0 hooks: @@ -19,6 +23,10 @@ repos: rev: v1.7.4 hooks: - id: actionlint + - repo: https://github.com/shellcheck-py/shellcheck-py + rev: v0.10.0.1 + hooks: + - id: shellcheck - repo: https://github.com/tox-dev/pyproject-fmt rev: v2.5.0 hooks: @@ -29,9 +37,7 @@ repos: - id: ruff args: ["--exit-non-zero-on-fix", "--fix"] - id: ruff-format - exclude: ^(tests/fixtures/|tests/test_formatter/__snapshots__/) - ci: autofix_commit_msg: "[pre-commit.ci] auto fixes from pre-commit.com hooks" autofix_prs: true diff --git a/.readthedocs.yml b/.readthedocs.yml index b244297a0..8e86cca59 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -1,5 +1,4 @@ version: 2 - build: os: ubuntu-lts-latest tools: {python: "3.12"} @@ -11,11 +10,9 @@ build: - poetry config virtualenvs.create false - poetry self add poetry-plugin-export - poetry export --only main --only docs --format=requirements.txt --output=requirements.txt - python: install: - requirements: requirements.txt - sphinx: configuration: 'docs/conf.py' # TODO: fix warnings and enable diff --git a/action.yml b/action.yml index c2b2cb12f..be5aecc65 100644 --- a/action.yml +++ b/action.yml @@ -9,7 +9,6 @@ description: 'Runs wemake-python-styleguide as a GitHub Action' branding: icon: 'check' color: 'green' - inputs: path: description: 'Path or space-separated list of paths to lint' @@ -34,7 +33,6 @@ inputs: outputs: output: description: 'The output of wemake-python-styleguide run' - runs: using: 'docker' image: 'Dockerfile' diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index 41b7ab00c..4de7a6bcc 100755 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -26,7 +26,7 @@ flake8 --version echo '=================================' echo -cd "$INPUT_CWD" +cd "$INPUT_CWD" || exit 1 # Runs `flake8`, possibly with `reviewdog`: if [ "$INPUT_REPORTER" == 'terminal' ]; then @@ -42,6 +42,7 @@ elif [ "$INPUT_REPORTER" == 'github-pr-review' ] || output=$(flake8 "$INPUT_PATH" --append-config='/action-config.cfg') echo "$output" | reviewdog -f=flake8 -reporter="$INPUT_REPORTER" -level=error # `reviewdog` does not fail with any status code, so we have to get dirty: + # shellcheck disable=SC2319 status=$(test "$output" = ''; echo $?) else output="Invalid action reporter specified: $INPUT_REPORTER" @@ -52,6 +53,7 @@ fi # See: https://help.github.com/en/articles/development-tools-for-github-action delimiter="$(dd if=/dev/urandom bs=15 count=1 status=none | base64)" # See: https://github.com/orgs/community/discussions/26288#discussioncomment-3876281 +# shellcheck disable=SC2129 echo "output<<$delimiter" >> "$GITHUB_OUTPUT" echo "$output" >> "$GITHUB_OUTPUT" echo "$delimiter" >> "$GITHUB_OUTPUT"