Skip to content

Commit

Permalink
build: add ruff to the automated requirement generation workflow (#1497)
Browse files Browse the repository at this point in the history
Add cog snippet to precommit-config to grab ruff version from
constraints file as usual.
  • Loading branch information
egparedes authored Mar 25, 2024
1 parent 618e9cf commit 759a241
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# -----------------------------------------------------------------------
# This file contains 'cog' snippets (https://nedbatchelder.com/code/cog/)
# to keep version numbers in sync with 'constraints.txt'
# -----------------------------------------------------------------------

default_language_version:
python: python3.10
Expand Down Expand Up @@ -42,7 +44,13 @@ repos:
- id: debug-statements

- repo: https://github.com/astral-sh/ruff-pre-commit
##[[[cog
## import re
## version = re.search('ruff==([0-9\.]*)', open("constraints.txt").read())[1]
## print(f"rev: v{version}")
##]]]
rev: v0.2.0
##[[[end]]]
hooks:
# Run the linter.
# TODO: include tests here
Expand Down

0 comments on commit 759a241

Please sign in to comment.