-
Notifications
You must be signed in to change notification settings - Fork 8
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
prevent absolute links to docs (except badge) #238
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## development #238 +/- ##
===============================================
- Coverage 97.30% 97.24% -0.06%
===============================================
Files 18 20 +2
Lines 1669 1815 +146
===============================================
+ Hits 1624 1765 +141
- Misses 45 50 +5 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is fine.
- Note that if you run
chmod +x prevent_absolute_links_to_docs.sh
locally and then commit those changes, you won't need to run it in the CI (git tracks permissions as well). - I would move this script from the root directory. Maybe to a new folder called
scripts/
or include it in the.github
directory? so as not to clutter up the root (I'm pretty sure that you'll have to change the path it's called on then). - maybe replace
grep -r nemos.readthedocs.io
withgrep -r -E https?://nemos.*
, since we're going to change the domain name soon. (the-E
allows you to use extended regex (not sure how that differs from regular regex, it's what I use), ands?
means it will matchhttp://nemos
or https://nemos`). - I'd probably add an explanation in
CONTRIBUTING
as to what relative vs. absolute means. I'm not sure it's obvious to the average scientist. E.g., "links must be relative, not absolute. That is, they should be of the form./path/to/page
rather thanhttps://nemos.readthedocs.io/path/to/page
." or something like that
that's cool
ok!
nice regex trick
will do |
After a second thought, I think it is safer to keep the explicit permission setting in the ci, and the execution time is basically minimal |
Added automation to the CI that checks for no absolute links to NeMoS docs.
The problem that absolute links may cause is described here #226.
Quoting
Note
The
CONTRIBUTING.md
contains a note that clarifies to use only relative links already. Look at the end of the file.