Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formatting: trim trailing whitespace #347

Merged
merged 1 commit into from
Jul 16, 2019

Conversation

Glutexo
Copy link
Collaborator

@Glutexo Glutexo commented Jul 12, 2019

Use the pre-commit-hooks trailing-whitespace-fixer tool to remove all trailing whitespaces from the textual files in the repository. Another pull request #348 adds the tool as a development dependency.

for PATTERN in '*.py' '*.ini' 'README' '*.mako' '*.yaml' '.gitignore' '*.yml' '*.groovy' 'Pipfile' 'Pipfile.lock' '*.md'
do
    find . -type f -name "$PATTERN" | xargs -L1 trailing-whitespace-fixer
done

This is a part of the way towards fixed formatting. See #189 and #331.

Use the pre-commit-hooks trailing-whitespace-fixer tool to remove all
trailing whitespaces from the textual files in the repository.
@Glutexo Glutexo self-assigned this Jul 12, 2019
@Glutexo Glutexo changed the title Formatting: ttrim trailing whitespace Formatting: trim trailing whitespace Jul 12, 2019
@Glutexo
Copy link
Collaborator Author

Glutexo commented Jul 15, 2019

This has been approved. Merge, @dehort, @lphiri?

@dehort dehort merged commit fdc1251 into RedHatInsights:master Jul 16, 2019
@Glutexo
Copy link
Collaborator Author

Glutexo commented Jul 18, 2019

For those of us who don’t like bash, here is a little script that runs a selected hook on all text files in the repository: https://gist.github.com/Glutexo/be5fe4febba36b7172ca117993bcbfd5 It leverages the fact that the pre-commit-hooks are actually a Python library and can be used not only as a shell command, but as a Python module as well.

@Glutexo Glutexo deleted the trailing_whitespace branch July 18, 2019 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants