I18n: Allow setting the allowed text-domains via the command-line. #807
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For people who work on a lot of WP projects and want to use a generic custom ruleset, setting the
text_domain
property in the ruleset would mean they would either need to have - yet another - custom ruleset in each project or they would need to manually edit the ruleset each time they would run PHPCS.Think: theme/plugin reviewers.
With that in mind, adding the ability to set the
$text_domain
property from the command-line as well, seemed a logical next step.Inspired by a remark made by @grappler.
To use this from the command-line:
phpcs -p . --standard=WordPress --runtime-set text_domain my-slug,default
Notes:
$text_domain_override
property from the sniff class and changed the unit test code to use the command line property instead.