question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The pre-commit autoupdate ignores `default_language_version` when `autoupdate`

See original GitHub issue

search you tried in the issue tracker

default_language_version autoupdate

describe your issue

I got pre-commit.ci autoupdate PR in which falke8 is updated to 6.0.0 even if default_language_version is specified to python 3.7.

https://github.com/Czaki/nme/pull/20#issue-1467321781

In the pre-commit.ci repository, I found information that they use a plain pre-commit autoupdate call.

Maybe important information is that flake8 6.0.0 specify a minimum version to 3.8.1

pre-commit --version

same as pre-commit.ci

.pre-commit-config.yaml

default_language_version:
    python: python3.7

repos:
-   repo: https://github.com/psf/black
    rev: 22.10.0
    hooks:
    - id: black
      pass_filenames: true
-   repo: https://github.com/PyCQA/autoflake
    rev: 'v1.7.7'  # Use the revision sha / tag you want to point at
    hooks:
    -   id: autoflake
        args: ["--remove-all-unused-imports", "-i"]
-   repo: https://github.com/PyCQA/flake8
    rev: 5.0.4
    hooks:
    - id: flake8
      pass_filenames: true
      # this seems to need to be here in addition to setup.cfg
      exclude: vendored|__init__.py|examples
      additional_dependencies:
      - flake8-tidy-imports
-   repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v4.3.0
    hooks:
    - id: check-json
    - id: check-yaml
    - id: check-merge-conflict
    - id: end-of-file-fixer
    - id: trailing-whitespace
      exclude: .*\.md
    - id: debug-statements
    - id: mixed-line-ending
-   repo: https://github.com/asottile/pyupgrade
    rev: v3.2.2
    hooks:
    - id: pyupgrade
      args: ["--py37-plus"]
-   repo: https://github.com/pre-commit/pygrep-hooks
    rev: v1.9.0
    hooks:
    -   id: rst-backticks
-   repo: https://github.com/PyCQA/isort
    rev: '5.10.1'  # Use the revision sha / tag you want to point at
    hooks:
    -   id: isort

-   repo: https://github.com/pre-commit/mirrors-mypy
    rev: 'v0.991'  # Use the sha / tag you want to point at
    hooks:
    -   id: mypy

~/.cache/pre-commit/pre-commit.log (if present)

No response

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
asottilecommented, Nov 29, 2022

if you don’t want autoupdate then don’t run autoupdate

0reactions
Czakicommented, Dec 1, 2022

my problem was solved just a few days after this issue: https://medium.com/google-colab/colab-updated-to-python-3-8-4922f9970a72

Read more comments on GitHub >

github_iconTop Results From Across the Web

ignore autoupdate for specific hook/s · Issue #1959
If pre-commit provide option to ignore autoupdate for specific hook just like pinning version then it will give freedom to users. It's just...
Read more >
pre-commit
You can update your hooks to the latest version automatically by running pre-commit autoupdate . By default, this will bring the hooks to...
Read more >
Tool Your Django Project: Pre-Commit Hooks
In the “default_language_version” section you can pre-define the default version for each supported language used in the repo. You should set ...
Read more >
pre-commit-config.yaml - platform/external/python/pybind11
pre-commit install # (runs every time you commit in git) ... pre-commit autoupdate ... By default, this ignores pyi files, though black supports...
Read more >
Automatically format and lint code with pre-commit - Interrupt
This article provides some background and guidelines for using pre-commit to automatically format and lint C-language firmware codebases.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found