pre-commit / pre-commit-hooks

Some out-of-the-box hooks for pre-commit
MIT License
5.34k stars 708 forks source link

except case for `double-quote-string-fixer` #1022

Closed emcek closed 8 months ago

emcek commented 8 months ago

Hi, Question, using hook: double-quote-string-fixer can I add exception to it?

I got one file in repository with is change by external program (during manual testing) to using double-quotes, so pre-commint and this soft constantly race and change back and fore ' <-> "

asottile commented 8 months ago

what have you tried?

emcek commented 8 months ago

I mean... how can I do that, except file from hook?

asottile commented 8 months ago

yes but what have you tried to accomplish that -- have you read the docs?

emcek commented 8 months ago
repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v4.5.0
    hooks:
      - id: trailing-whitespace
      - id: end-of-file-fixer
      - id: check-docstring-first
      - id: debug-statements
      - id: double-quote-string-fixer
        exclude: 'qtgui_rc.py'
      - id: check-toml
      - id: check-yaml
      - id: check-json
      - id: requirements-txt-fixer
      - id: fix-byte-order-marker

this throw a bunch of errors....

asottile commented 8 months ago

"throw a bunch of errors" I cannot see them

emcek commented 8 months ago

I spotted typo :| sorry wasting your time... I really need buy yellow rubber duck ;)