-
Notifications
You must be signed in to change notification settings - Fork 74
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
Improve RedPen custom resource loading #551
Conversation
…nsibility to provide a logging backend, but redpen-cli should have one by itself
…dCachedFromResource() doesn't find the file
… to resolve custom dictionaries and other files in Validators
… private in Validator
… of them consistent
…ir and look for files in both
Hmm... Removing ensureFileIsInsideRedPenHomeOrWorkingDirectory looks unsafe... @yusuke Can you please tell me your idea on the changes? |
findFile() already looks in particular places to resolve the files or throws the same exception as ensureFileIsInsideRedPenHomeOrWorkingDirectory() did if the file is not found. There seems to be no other reason of restricting where the files should be located, isn't it? The method looked obsolete to us. |
@cbxp I would like to know where is tests for restricting the js directory is throwing the exception. |
We have added the missing tests |
Improve RedPen custom resource loading
Thanks! |
Custom resources will now be looked for from 3 places:
All Validators now have access to this functionality via Validator.findFile().
All existing validators were updated to use it.
WARNING: This pull request depends (contains the same changes) on this one #550, please merge #550 first.
Review changes starting from this commit: codeborne@042cfdc