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

Improve RedPen custom resource loading #551

Merged
merged 18 commits into from
Feb 26, 2016

Conversation

cbxp
Copy link

@cbxp cbxp commented Feb 25, 2016

Custom resources will now be looked for from 3 places:

  • Working directory
  • Relative to the config file (new feature)
  • From REDPEN_HOME directory

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

Anton Keks, Dmitri Ess added 17 commits February 23, 2016 10:32
…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
@takahi-i
Copy link
Member

Hmm... Removing ensureFileIsInsideRedPenHomeOrWorkingDirectory looks unsafe...

@yusuke Can you please tell me your idea on the changes?

@cbxp
Copy link
Author

cbxp commented Feb 26, 2016

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.

@takahi-i
Copy link
Member

@takahi-i
Copy link
Member

@cbxp I would like to know where is tests for restricting the js directory is throwing the exception.

@cbxp
Copy link
Author

cbxp commented Feb 26, 2016

We have added the missing tests

takahi-i added a commit that referenced this pull request Feb 26, 2016
Improve RedPen custom resource loading
@takahi-i takahi-i merged commit 80675ff into redpen-cc:master Feb 26, 2016
@takahi-i
Copy link
Member

Thanks!

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.

2 participants