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

Do not try to validate runtime options when loading bin script #95

Merged
merged 2 commits into from
Aug 24, 2023

Conversation

sirbrillig
Copy link
Owner

When the bin script is loading, it performs certain operations which need to be run before the full CliOptions objects can be safely created and validated. Notably, it needs to scan for valid filenames and, if the -i option was provided, it needs to create a shell to ask phpcs for its installed standards.

However, currently both these operations can fail because they both require creating a CliOptions object when it might not be valid.

This PR makes it so that the CliOptions object is not validated when it would likely be invalid. Specifically, it changes the filename validation to use the raw --extensions data and it creates a new mode, INFO_ONLY, that can be used to safely run the -i option.

Fixes #94

@sirbrillig sirbrillig merged commit e31c0ad into trunk Aug 24, 2023
@sirbrillig sirbrillig deleted the fix/bin-script-cli-options branch August 24, 2023 23:21
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.

Unable to run in git mode on directories
1 participant