Skip to content

Commit

Permalink
Enable pre-commit autoupdate PRs (#929)
Browse files Browse the repository at this point in the history
# Pull Request

## Title

Enable pre-commit autoupdate PRs

---

## Description

Adds configs for pre-commit.ci to use to scan our repo and automatically
submit PRs to update pre-commit hook version monthly.

---

## Type of Change

- ✨ New feature

---

## Additional Notes (optional)

This also enables autofix PRs to hopefully improve the turnaround time
on PR reviews by automatically applying formatting fixups to a PR.

This could get confusing or annoying if PR authors don't locally pull
after fixes are applied or if the formatters do something drastic that
we aren't anticipating, so we may consider to disable this in the future
as well.

---

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sergiy Matusevych <[email protected]>
  • Loading branch information
3 people authored Jan 13, 2025
1 parent 845999f commit 3c319cd
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
# Enable automatic updates via Github Actions as well.
# See https://pre-commit.ci
ci:
# Let pre-commit.ci automatically update PRs with formatting fixes.
autofix_prs: true
# skip local hooks - they should be managed manually via conda-envs/*.yml
skip: [mypy, pylint, pycodestyle]
autoupdate_schedule: monthly
autoupdate_commit_msg: |
[pre-commit.ci] pre-commit autoupdate
for more information, see https://pre-commit.ci
NOTE: Be sure to also check for other possible hook updates in the conda-envs/*.yml files (e.g., mypy, pylint, etc.).
See Also:
- https://github.com/microsoft/MLOS/blob/main/conda-envs/mlos.yml
- https://pypi.org/project/mypy/
- https://pypi.org/project/pylint/
- https://pypi.org/project/pycodestyle/
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
default_stages: [pre-commit]
Expand All @@ -6,7 +26,7 @@ default_stages: [pre-commit]
# are partitioned and the hook executable called in parallel across them, not
# whether hooks themselves are parallelized.
# As such, some hooks (e.g., pylint) which do internal parallelism need it set
# for effeciency and correctness anyways.
# for efficiency and correctness anyways.

repos:
#
Expand Down

0 comments on commit 3c319cd

Please sign in to comment.