pcdshub / pcdshub/hutch-python

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

Open
#335 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1
Forks
18
Avg merge
7d 9h
Merged PRs (30d)
1

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the pre-commit hooks and reviewing versioneer.py, docs/source/conf.py, generated version.py files, and the cookiecutter conf.yml pattern listed in the issue. Compare the related elog PR discussion for the intended handling. Done means the hooks pass for these generated or vendored files without removing necessary checks.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.