Closed mschwoer closed 1 month ago
The version is fixed, for the 0.4.7 tag you can see the dependencies have changed.
But to verify further you can modify your pre-commit hook to contain a similar hook to the repo.
i.e.
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.4.6
hooks:
- id: ruff
name: ruff
description: "Run 'ruff' for extremely fast Python linting"
entry: ruff --version
language: python
types_or: [ python, pyi ]
args: [ ]
require_serial: true
additional_dependencies: [ ]
minimum_pre_commit_version: "2.9.2"
Now when you run it you can see the specified version
$: pre-commit run --all-files -v
ruff.....................................................................Passed
- hook id: ruff
- duration: 0.01s
ruff 0.4.6
Yes that's right -- if you include rev
, pre-commit will always use the Ruff version that you marked in rev
!
Hi, not sure if this is a pre-commit, or a ruff, or a ruff-pre-commit issue (or even no issue at all) :-)
I use ruff pre-commit hook locally as well as in the github action
pre-commit/action@v3.0.1
. This means, it is important that both the local version and the one used by the gh action apply the exact same set of rules (for which employing the exact same ruff version is a prerequisite).After the latest ruff release v0.4.8, my local and the gh action version apparently starting to use a different ruleset, although I thought I fixed all versions (especially with the
rev: v0.4.0
, see below).After changing in
.pre-commit.yaml
torev: v0.4.8
, the rulesets match again.I suppose that the
rev: v0.4.0
is ignored and the latest version is always used? Unfortuntately I could not proof this, as ruff does not print its verson number when it runs.thanks for this great tool! cheers, Magnus
Relevant environment:
.pre-commit.yaml
locally, I use
pip install pre-commit==3.7.0
(ruff is not installed directly)MacBookPro M3, MacOS 14.3 (23D56)
Python 3.11.9 (main, Apr 19 2024, 11:43:47) [Clang 14.0.6 ] on darwin