Skip to content

Make auto-generated / vendored files pass pre-commit hooks #335

@tangkong

Description

@tangkong

Expected Behavior

We want pre-commit hooks to pass

Current Behavior

There are various files that we don't necessarily need to pass checks, and many of our repos have them

for example, versioneer.py uses raw strings in regex that flake8 doesn't like

for line in f.readlines():
            if line.strip().startswith("git_refnames ="):
                mo = re.search(r'=\s*"(.*)"', line)
                if mo:

docs/conf.py also has import orders that might be necessary but isort objects to.

Possible Solution

  • Omit these files from pre-commit hooks?
  • Fix all the files in the same way?

List of files to skip checks on:

  • versioneer
    • versioneer.py
    • {repo}/version.py
  • docs/source/conf.py
  • cookiecutter
    • {repo}/cookiecutter/.*/conf.yml (hutch-python specific?)

Context

we want style. See the related elog PR

Your Environment

all of them, but pcds-5.3.1

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