Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Action to run pre-commit on all pull requests #311

Closed
wants to merge 4 commits into from
Closed
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
18 changes: 18 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
# https://pre-commit.com
# This workflow assumes the repo contains a valid .pre-commit-config.yaml file.
name: pre-commit
on:
pull_request:
push:
branches: [master]
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- run: pip install pre-commit
- run: pre-commit --version
- run: pre-commit install
- run: pre-commit run --all-files
2 changes: 1 addition & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Fixed
- Consider ``.py.tmp`` as files which should be reformatted.
This enables VSCode Format On Save.
- Use the latest release of Darker instead of 1.3.2 in the GitHub Action.


1.4.0_ - 2022-02-08
===================
Expand Down
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -558,9 +558,9 @@ Create a file named ``.github/workflows/darker.yml`` inside your repository with
.. code-block:: yaml

name: Lint

on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -651,7 +651,7 @@ Here's an example of `cov_to_lint.py`_ output::
+-----------------------------------------------------------------------+
| ⚠ NOTE ⚠ |
+=======================================================================+
| Don't enable linting on the command line or in the configuration when |
| Don't enable linting on the command line or in the configuration when |
| running Darker as a reformatter in VSCode. You will confuse VSCode |
| with unexpected output from Darker, as it only expect black's output |
+-----------------------------------------------------------------------+
Expand Down
2 changes: 1 addition & 1 deletion constraints-future.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
# still works against upcaming releases of Python ependencies. Keep this
# up-to-date by adding entries for any packages we want to get early
# incompatibility warnings for.
black @ git+https://github.com/psf/black.git@main
black @ git+https://github.com/psf/black.git@main
isort @ git+https://github.com/PyCQA/isort.git@main
2 changes: 1 addition & 1 deletion constraints-oldest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ requests_cache==0.7
ruamel.yaml==0.17.21
safety==1.10.3
toml==0.10.0
types-toml==0.10.4
types-toml==0.10.4
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,4 @@ ignore =

[codespell]
ignore-words-list = nd
skip = .git,*.json
skip = .git,*.json