Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
# Full history is required so `--from-ref`/`--to-ref` below can diff
# the PR's base and head commits.
fetch-depth: 0

- name: Setup python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
Expand All @@ -41,3 +45,11 @@ jobs:

- name: Run pre-commit
uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
with:
# Pull requests: only check the files the PR actually changes, so lint
# debt elsewhere on master cannot block an unrelated contribution.
# Pushes to master and manual runs: check everything.
extra_args: >-
${{ github.event_name == 'pull_request'
&& format('--from-ref {0} --to-ref {1}', github.event.pull_request.base.sha, github.event.pull_request.head.sha)
|| '--all-files' }}
6 changes: 4 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
---
# pre-commit install --allow-missing-config && pre-commit autoupdate && pre-commit run --all-files --color auto
# Local setup: pip install pre-commit && pre-commit install
# Run everything: pre-commit run --all-files
exclude: |
(?x)^(
old-versions/.*
)
fail_fast: true
# Report every failing hook in one run instead of stopping at the first one.
fail_fast: false
default_stages:
- pre-commit
default_language_version:
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,18 @@ However, when using CI/CD tools to provide automation, keep in mind that the too

Contributions are welcome: fix a typo, add a tool, or propose a new topic by opening an issue or pull request. Please keep tool lists vendor-neutral and alphabetically ordered, and update the Table of Contents when adding or renaming files (see [doc-utilities](doc-utilities/README.md) for the TOC generator).

### Running the checks locally

CI runs [pre-commit](https://pre-commit.com/) (Markdown lint, trailing whitespace, end-of-file newline, YAML/JSON validity) on every pull request. Running the same hooks locally before you push avoids a red CI run:

```bash
python3.13 -m pip install pre-commit
pre-commit install # run the hooks automatically on every commit
pre-commit run --all-files # or run them once across the whole repository
```

On pull requests CI only checks the files you changed; pushes to `master` check the whole repository.

## Previous versions

Earlier editions are kept in [old-versions](old-versions/) (V0.1, V0.2, V0.3).
Expand Down
Loading