gjtorikian / html-proofer

Test your rendered HTML files to make sure they're accurate.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

lwasser opened this issue · comments

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.+/"

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.

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. ✌️

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?

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.

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.