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

Nggw 94 tabs eol #10

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Nggw 94 tabs eol #10

wants to merge 3 commits into from

Conversation

Gintron
Copy link

@Gintron Gintron commented Mar 6, 2023

GIT hook for checking tabs vs spaces and EOL

@Gintron Gintron requested review from emodric and iherak March 6, 2023 08:25
@iherak
Copy link
Member

iherak commented Mar 6, 2023

This only includes php files - I think we should make sure to handle at least scss and js files as well?
Also, this does not seem to check the EOL type at all, only the trailing spaces?

Personally, I would also like to see a hook which requires empty last line as well.

@emodric
Copy link
Member

emodric commented Mar 6, 2023

And Twig files too. But in general, every file committed should be checked, except Makefile

use function array_diff;
use function implode;

final class CheckForSpacesInEOL extends Action
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be named e.g. CheckForWhiteSpaceAtEOL, since it doesn't only remove spaces but all whitespace.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The class is renamed now

}
}

private function getChangedFiles(Config\Action $action, Repository $repository): array
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move this duplicated method to a base Action class?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method is moved to the Action class

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.

3 participants