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

Q: Changing ForbiddenFunctions list for one specific directory #2855

Open
AllenJB opened this issue Feb 5, 2020 · 2 comments
Open

Q: Changing ForbiddenFunctions list for one specific directory #2855

AllenJB opened this issue Feb 5, 2020 · 2 comments

Comments

@AllenJB
Copy link

@AllenJB AllenJB commented Feb 5, 2020

I have a ForbiddenFunctions rule with a custom list of forbiddenFunctions, which includes "is_object". But for one specific directory I want to allow the use of is_object() but still keep the other list entries forbidden.

Is there a way to adjust the property for a specific directory? Or what's the easiest way to achieve this?

@gsherwood gsherwood added the Question label Feb 9, 2020
@gsherwood gsherwood added this to Idea Bank in PHPCS v3 Development via automation Feb 9, 2020
@gsherwood

This comment has been minimized.

Copy link
Member

@gsherwood gsherwood commented Feb 9, 2020

Is there a way to adjust the property for a specific directory?

No, this feature is not available.

Or what's the easiest way to achieve this?

You can set different config options for a specific file, but there is no way to do this for an entire directory.

You'd need to create a new standard for that specific directory, which imports the main standard but sets the config differently for this sniff. The main standard would need to exclude this directory and then new standard would need to only check this directory. It's not a nice setup.

@AllenJB

This comment has been minimized.

Copy link
Author

@AllenJB AllenJB commented Feb 13, 2020

Thanks for the reply. It would be nice if you could do this without setting up a new standard. Something similar to using include/exclude path patterns to control the properties for a rule, or have rules appear multiple times in a standard as separate instances by giving them an alias.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.