Skip to content

When running reuse via pre-commit, ignore untracked files (or: create lint-file) #578

@vHanda

Description

@vHanda

Hello.

I sometimes have some random files which I haven't committed and don't necessarily plan to, but I don't want to add them to the '.gitignore'. Reuse complains about those files.

It would be awesome if I could run reuse with a --ignore-untracked option, which ignores all files which aren't in git index.


comment by @carmenbianca :

Other linters, pylint etc, when run via pre-commit, only run against staged/tracked files. This is a behaviour of pre-commit, which passes (I think) a list of files to the linters. reuse differs here, because there's presently no way to run the linter against a subset of files.

Let's create lint-file to lint a subset of files, and then allow the pre-commit to be configured to use that instead of lint.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions