-
-
Notifications
You must be signed in to change notification settings - Fork 200
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
feat: enable specifying a root folder #540
feat: enable specifying a root folder #540
Conversation
Enables user to run .check_file while having a non-flat file hierarchy.
I like the idea, although it seems the test is failing. 🤔 |
Weird! Works on my machine. I will try to reproduce. |
Tried booting up a ubuntu:16.04 container and following the exact footsteps of travis... Still runs smoothly. Could you help me out with debugging this one? 😓 |
@Graborg Can you set this PR to accept changes from the maintainer? I think I have the fix, I just want to see it in CI. |
Or I suppose I could just tell you the fix: diff --git a/spec/html-proofer/links_spec.rb b/spec/html-proofer/links_spec.rb
index 3082671..e016145 100644
--- a/spec/html-proofer/links_spec.rb
+++ b/spec/html-proofer/links_spec.rb
@@ -81,7 +81,7 @@ describe 'Links test' do
it 'succeeds for working internal-root-links pointing to other folder' do
broken_root_link_internal_filepath = "#{FIXTURES_DIR}/links/working_root_link_internal.html"
- proofer = run_proofer(broken_root_link_internal_filepath, :file, {:root_dir => "/app/spec/html-proofer/fixtures"})
+ proofer = run_proofer(broken_root_link_internal_filepath, :file, { root_dir: 'spec/html-proofer/fixtures' })
expect(proofer.failed_tests).to eq []
end
|
Codecov Report
@@ Coverage Diff @@
## master #540 +/- ##
=========================================
Coverage ? 98.56%
=========================================
Files ? 30
Lines ? 1949
Branches ? 0
=========================================
Hits ? 1921
Misses ? 28
Partials ? 0
Continue to review full report at Codecov.
|
Hi! Anything I can do to help get this PR merged? (Along with the others) Thanks |
Thanks! |
Before: When running .check_file(...) on a file in a non-flat file-hierarchy, it is not possible to specify the root folder from which folder the file is being served. Instead the specified file's folder is assumed as root.
This leads to false positives when refering to a file outside of the specified file's folder.
After: enable specifying a root_dir from where the file is served, when a link begining with slash is found, html-proofer now checks the root_dir for any refered files, so all internal links can be resolved properly.