Skip to content

bug: pre-commit's script is installed in migration mode #3279

@domsj-foodpairing

Description

@domsj-foodpairing

search you tried in the issue tracker

migration

describe your issue

I'm using pre-commit inside a devcontainer.
I use visual studio and the built-in vcs + gitlens extension
Every now and then commit fails and I get the following message

> git -c user.useConfigOnly=true commit --quiet --allow-empty-message --file -
bug: pre-commit's script is installed in migration mode
run `pre-commit install -f --hook-type pre-commit` to fix this

Please report this bug at https://github.com/pre-commit/pre-commit/issues
ruff.....................................................................Passed
black....................................................................Passed
mypy type checks.........................................................Passed
bandit...................................................................Passed
sqlfluff-dashboards-linter...........................(no files to check)Skipped
eslint...............................................(no files to check)Skipped
prettier.............................................(no files to check)Skipped
check for added large files..............................................Passed
fix end of files.........................................................Passed
don't commit to branch...................................................Passed

I then run pre-commit install -f --hook-type pre-commit after which things work again for some time

pre-commit --version

3.7.1

.pre-commit-config.yaml

fail_fast: true
repos:
    - repo: local
      hooks:
          - id: ruff
            name: ruff
            language: system
            entry: poetry run ruff check . --fix
            types: ["python"]

          - id: black
            name: black
            language: system
            entry: poetry run black .
            types: ["python"]

          - id: mypy
            name: mypy type checks
            language: system
            entry: poetry run mypy
            types: ["python"]

          - id: bandit
            name: bandit
            language: system
            entry: poetry run bandit -c pyproject.toml -r .
            types: ["python"]

          - id: sqlfluff-dashboards-linter
            name: sqlfluff-dashboards-linter
            language: system
            entry: poetry run python -m scripts.pre_commit_configs.sqlfluff_dashboards_linter
            files: ^dashboards\/.*\/.*\.sql$

# when DEV container is used for development, uncomment this and use forward slashes in .unimportedrc.json
#          - id: unimported
#            name: unimported
#            language: system
#            entry: bash -c 'cd frontends/cfi && npm run unimported'
#            pass_filenames: false
#            types: [file]
#            files: ^frontends\/cfi\/src\/.*\.[jt]sx?$
#            args: [--error]


    - repo: https://github.com/pre-commit/mirrors-eslint
      rev: "v8.48.0"
      hooks:
          - id: eslint
            args:
                [
                    --config,
                    frontends/cfi/.eslintrc.js,
                    --ignore-path,
                    frontends/cfi/.eslintignore,
                    --fix
                ]
            files: ^frontends\/cfi\/src\/.*\.[jt]sx?$
            types: [file]
            additional_dependencies:
                - eslint@8.48.0
                - eslint-config-airbnb@19.0.4
                - eslint-config-prettier@8.5.0
                - eslint-plugin-import@2.26.0
                - eslint-import-resolver-typescript@2.7.1
                - eslint-plugin-jsx-a11y@6.7.1
                - eslint-plugin-prettier@5.0.0
                - eslint-plugin-react@7.32.2
                - eslint-plugin-react-hooks@4.4.0
                - "@typescript-eslint/eslint-plugin@5.20.0"
                - "@typescript-eslint/parser@5.20.0"
                - prettier@3.0.3

    - repo: https://github.com/pre-commit/mirrors-prettier
      rev: "v3.0.3"
      hooks:
          - id: prettier
            args:
                [
                    --config,
                    frontends/cfi/.prettierrc.js,
                    --ignore-path,
                    frontends/cfi/.prettierignore,
                    --write,
                ]
            files: ^frontends\/cfi\/src\/.*\.(css|less|scss|graphql|gql|md|tsx|ts|js|jsx)$

    - repo: https://github.com/pre-commit/pre-commit-hooks
      rev: v4.5.0
      hooks:
          - id: check-added-large-files
            args: ['--maxkb=200000']
          - id: end-of-file-fixer
          - id: no-commit-to-branch
            args: [--branch, master, --branch, develop]

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

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions