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

Respect config settings when creating pre-commit hook #39

Open
ghost opened this issue May 20, 2017 · 4 comments
Open

Respect config settings when creating pre-commit hook #39

ghost opened this issue May 20, 2017 · 4 comments
Labels

Comments

@ghost
Copy link

ghost commented May 20, 2017

https://github.com/stevegrunwell/wp-enforcer/blob/develop/bin/hooks/pre-commit#L9

This line is hard-coded and does not respect the -c flag of the CLI.

# Determine if we have a phpcs.xml file
if [[ -f ./phpcs.xml ]]; then
	standard="--standard=./phpcs.xml"
else
	standard=''
fi

The above needs to be updated to accept an arg when -c is set in the CLI.

@bswatson
Copy link
Collaborator

@JHabdas I wanted to let you know that @stevegrunwell is AFK for the next week, so he may be a bit delayed in his responses.

@ghost
Copy link
Author

ghost commented May 20, 2017

@bswatson thanks for the heads up. 👌 i'll just keep riffing on my fork and see where I can get

@stevegrunwell stevegrunwell added this to the 0.5.0 milestone May 27, 2017
@stevegrunwell
Copy link
Owner

@JHabdas Mind clarifying which package's -c option you're talking about? Neither WP Enforcer nor PHP_CodeSniffer have a -c, and the hard-coded check is to see whether or not a phpcs.xml file (the filename specified in the PHP_CodeSniffer docs for a default ruleset and the file created when WP Enforcer is installed) exists.

The pre-commit hook is not meant to be run interactively or accept varying options, as it's run automatically when a user attempts to commit to the repository.

Am I missing something here?

@stevegrunwell stevegrunwell removed this from the 0.5.0 milestone May 28, 2017
@ghost
Copy link
Author

ghost commented May 28, 2017

-c is the shorthand notation for --config as is currently used in the enforcer CLI IIRC. Hope that helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants