htmllint / htmllint-cli

A command line interface for htmllint.
ISC License
59 stars 32 forks source link

** Doesn't work recursively #15

Open GuyHadas opened 8 years ago

GuyHadas commented 8 years ago

app.zip

Getting script to find all the html files is not doable with \ in path.

juanjoDiaz commented 8 years ago

Any chance of fixing this soon??

Just to elaborate a bit more... Let's say we have a project as:

|-- src
    | -- css
        | -- ...
    | -- html
        | -- module1
            | -- ...
        | -- module2
            | -- ...
        | -- index.html
    | -- js
        | -- ...

If I do htmllint src/html/**/*.html, only src/html/index.html will be linted. On the other hand, If I do htmllint src/html/**/**/*.html, only the contents of src/html/module1 and src/html/module2 will be linted

Potherca commented 7 years ago

Until this is resolved, a variation of the following might work for you:

htmllint $(find . -name '*.html')
mlochbaum commented 6 years ago

FINALLY had a look at this. It seems like the only problem is that the shell is catching these patterns and expanding them incorrectly before they get to htmllint. To avoid this enclose in double quotes: htmllint "src/html/**/*.html". This is awkward, but other commands like find have similar problems so it's nothing unheard of.

Can someone confirm that enclosing in quotes works correctly?

compeek commented 4 years ago

FINALLY had a look at this. It seems like the only problem is that the shell is catching these patterns and expanding them incorrectly before they get to htmllint. To avoid this enclose in double quotes: htmllint "src/html/**/*.html". This is awkward, but other commands like find have similar problems so it's nothing unheard of.

Can someone confirm that enclosing in quotes works correctly?

@mlochbaum I realize this is very old, but thank you for the suggestion. It works for me.