Surpress warnings with --silent
See original GitHub issueHi,
I’ve dockerized pre-commit and every time I run in, it mounts my repo in the docker and runs pre-commit run --all-files
.
Every time, however, I’m getting warnings which I would like to surpress or remove:
[WARNING] The 'rev' field of repo 'https://github.com/pre-commit/pre-commit-hooks' appears to be a mutable reference (moving tag / branch). Mutable references are never updated after first install and are not supported. See https://pre-commit.com/#using-the-latest-version-for-a-repository for more details. Hint: `pre-commit autoupdate` often fixes this.
[WARNING] The 'rev' field of repo 'https://github.com/psf/black' appears to be a mutable reference (moving tag / branch). Mutable references are never updated after first install and are not supported. See https://pre-commit.com/#using-the-latest-version-for-a-repository for more details. Hint: `pre-commit autoupdate` often fixes this.
I guess these comes from the black
and pre-commit-hooks
github references in the config file. Any ideas how to reduce verbosity here?
I’m mounting my cache (~/.cache/pre-commit
) into docker.
Here is my .pre-commit-config.yaml
:
exclude: 'docs|node_modules|migrations|.git|.tox'
default_stages: [commit]
fail_fast: true
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: master
hooks:
- id: trailing-whitespace
files: (^|/)a/.+\.(py|html|sh|css|js)$
- id: check-merge-conflict
- id: check-ast
- id: check-json
- id: check-yaml
- id: debug-statements
- id: check-docstring-first
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: end-of-file-fixer
- id: fix-encoding-pragma
- id: trailing-whitespace
- id: pretty-format-json
- repo: https://github.com/psf/black
rev: stable
hooks:
- id: black
language_version: python3
- repo: local
hooks:
- id: flake8
name: flake8
entry: flake8
language: python
types: [python]
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Is a "--silent" flag supposed to suppress warnings and errors ...
1 Answer 1 · Have a meaningfull returncode. · If your application can produce lots of warnings, have a flag to filter only...
Read more >Suppress compiler warnings - Visual Studio - Microsoft Learn
In Solution Explorer, choose the project in which you want to suppress warnings. Right-click on the project node, and choose Properties on ...
Read more >Silence Warnings From the Test Suite
When running Python's test suite, no warnings should result when you run it under strenuous testing conditions (you can ignore the extra flags...
Read more >No way to silence warnings · Issue #6672 · yarnpkg/yarn
Either yarn --silent should be truly silent, or a log level configuration should be added to add the ability to ignore warnings.
Read more >How to disable Python warnings? - Stack Overflow
If you rely on the current behaviour, change it to [this other thing] . I would rather ignore the warnings now and wait...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
also some other hints:
exclude
has some unnecessary entries, pre-commit never runs on files that aren’t checked inlocal
flake8
hook is a fork bomb, you should use https://github.com/pycqa/flake8@asottile that was my initial though, but since the context is docker, changes would be lost on restart.