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

QUESTION - ignore-files syntax not ignore entire directories as I would expect it to. Is my approach syntax incorrect? #775

Closed
lwasser opened this issue Oct 10, 2022 · 5 comments · Fixed by #776

Comments

@lwasser
Copy link

lwasser commented Oct 10, 2022

Hi Colleagues,
I'm super appreciative of html proofer and use it in many builds.

I'm struggling with getting ignore-files to work as expected and the documentation and other issues haven't yet helped me.

i'm trying to ignore two directory paths:

  • html/_static
  • html/reference/meeting-notes/* (everything in meeting notes including subdirectories)

It's ignoring the _static dir but not the meeting notes.

Here is my build:

I want the build to ignore both the static dir and the meeting-notes dir. I've tried many things after reading through other issues including:

  • escaping the second dir \/, not escaping it, using the full path _build/html and not using it. I am not sure i understand how to correctly tell html proofer to skip over a few different directories in my build. Many thanks for any help.
uses: chabad360/htmlproofer@master
        with:
          directory: '_build/html'
          arguments: |
           --ignore-files "/html/_static/, /reference\/meeting-notes\/2019/" # do i need to escape this?

Failure looks like

* At _build/html/reference/meeting-notes/2019/2019-04-04-notes.html:524:

  External link https://www.pyopensci.org/dev_guide/peer_review/peer_review_proc.html#review-timeline failed (status code 404)

* At _build/html/reference/meeting-notes/2019/2019-04-04-notes.html:525:

  External link https://www.pyopensci.org/dev_guide/peer_review/editor_guide.html#editor-checklist failed (status code 404)

Thank you for any guidance!! it's simply not ignoring but i'm not sure what i'm doing wrong.

Update: i've tried a few other things looking at SO and other sites but it's still not working.
Currently trying - seeing if some regex could help

      - name: Check HTML using htmlproofer
        uses: chabad360/htmlproofer@master
        with:
          directory: '_build/html'
          arguments: |
           --ignore-files "/html/_static/, /.+\/reference\/meeting-notes.+/"
@lwasser lwasser changed the title QUESTION - ignore-files syntax QUESTION - ignore-files syntax not ignore entire directories as I would expect it to. Is my approach syntax incorrect? Oct 10, 2022
@gjtorikian
Copy link
Owner

Hi there. One thing I find curious is that the version of HTML Proofer being used is 4.4.2—the program is on 5.x now. That shouldn't necessarily be causing this problem but you might want to upgrade, because a lot of fixes were made.

Thank you for the detailed report. I'm going to clone your repo and see if I can repro the error.

@gjtorikian
Copy link
Owner

Your command almost had it: it should be "/.+\/_static/,/.+\/reference\/meeting-notes.+/" (note the space after the , has been removed).

I tried this locally and it should also work for you; let me know if it doesn't.

PS If this open source project is helping you, please consider sponsoring it. ✌️

@lwasser
Copy link
Author

lwasser commented Oct 25, 2022

hey @gjtorikian !!
I'm really happy that you let people know about this project being open source and suggest sponsorship! i think that is awesome. i'm actually building an organization around python open source to support maintainers like you in the scientific space (pyopensci) and helping people understand that most maintainers are doing this work on their own time and not paid is so important 👐 .

thank you so much. that fix helped / fixed things on version 4.4.2 BUT now on 5.0 i'm running into the same thing again oddly. did 5.0 by chance change something related to parsing strings?

here is a build where it ran - right after you helped me!

today i noticed other builds were breaking so i decided to try the rebuild the repo where it was working again

Exact same code and file base not does NOT ignore directories as as it did in 4.x.

Any ideas why? I've once again tried variations on the syntax including static/.+ etc that seem to better catch files within the dir using rubular but none of those variations seem to work.

again many thanks for the work that you do here!! We are using html proofer in all of the pyOpenSci documentation and for the website. maybe we can promote your work there as well to Python maintainers who want to test their docs?

@lwasser
Copy link
Author

lwasser commented Nov 1, 2022

gosh i still can't figure this out. i've tried several variations of telling it to ignore directories and am still unable to get things to work with version 5.0 whereas it did work in version 4.4.2 . hoping someone else has run into this or has any ideas on how to fix. many thanks.

@gjtorikian
Copy link
Owner

gosh i still can't figure this out.

Ah, there appeared to be a bug, which #776 has just fixed in 5.0.1.

again many thanks for the work that you do here!! We are using html proofer in all of the pyOpenSci documentation and for the website. maybe we can promote your work there as well to Python maintainers who want to test their docs?

That would be appreciated, but promotion and exposure doesn't pay the bills.

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 a pull request may close this issue.

2 participants