Skip to content

Meta: Add trailing-whitespace and end-of-file-fixer to pre-commit config #4067

@lysnikolaou

Description

@lysnikolaou

I was trying to remove all trailing whitespace from PEP 750 and noticed that we currently do not have trailing-whitespace and end-of-file-fixer in our pre-commit config. I think it makes sense to include these. From the pre-commit-hooks README:

end-of-file-fixer: Makes sure files end in a newline and only a newline.

trailing-whitespace
Trims trailing whitespace.

  • To preserve Markdown hard linebreaks
    use args: [--markdown-linebreak-ext=md] (or other extensions used
    by your markdownfiles). If for some reason you want to treat all files
    as markdown, use --markdown-linebreak-ext=*.
  • By default, this hook trims all whitespace from the ends of lines.
    To specify a custom set of characters to trim instead, use args: [--chars,"<chars to trim>"].

Do people have objections?

Metadata

Metadata

Assignees

No one assigned

    Labels

    metaRelated to the repo itself and its processes

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions