Opened 11 years ago
Closed 11 years ago
#27567 closed defect (bug) (fixed)
grunt jshint task for individual files does not work
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.0 | Priority: | low |
Severity: | minor | Version: | |
Component: | Build/Test Tools | Keywords: | has-patch commit |
Focuses: | docs | Cc: |
Description
Based on the inline docs in Gruntfile.js
we should be able to run the grunt task jshint
on a single file using eg grunt jshint:core --file=Gruntfile.js
~/develop.wp.nw [trunk ~2 ?2]> grunt jshint:core --file=Gruntfile.js Running "jshint:core" (jshint) task >> 0 files linted. Please check your ignored files. Done, without errors. ~/develop.wp.nw [trunk ~2 ?2]>
Expected result should be that file is checked and if no linting is required to return the results similar to that of running grunt jshint:grunt
~/develop.wp.nw [trunk ~2 ?2]> grunt jshint:grunt Running "jshint:grunt" (jshint) task >> 1 file lint free. Done, without errors. ~/develop.wp.nw [trunk ~2 ?2]>
Attachments (3)
Change History (13)
#1
@
11 years ago
- Keywords needs-docs has-patch added
- Milestone changed from Awaiting Review to Future Release
- Priority changed from normal to low
- Severity changed from normal to minor
#3
follow-up:
↓ 4
@
11 years ago
Awesome, understand now, and read the code ;)
For example plugin.js
there are 7 files with this specific file name included via the jshint:core
src:
paths.
~/develop.wp.nw [trunk ~3 ?6]> grunt jshint:core --file=plugin.js Running "jshint:core" (jshint) task >> 7 files lint free. Done, without errors.
Maybe // Limit JSHint's run to a specific core file name.
as it will not always be a single file.
#4
in reply to:
↑ 3
;
follow-up:
↓ 5
@
11 years ago
- Keywords needs-docs removed
Replying to netweb:
Maybe
// Limit JSHint's run to a specific core file name.
as it will not always be a single file.
Would you care to iterate on 27567.diff? Maybe something like:
// Limit JSHint's run to all core files with the specified file name.
#5
in reply to:
↑ 4
@
11 years ago
Replying to DrewAPicture:
// Limit JSHint's run to all core files with the specified file name.
Nice, Thanks, Done in 27567.2.diff
#7
@
11 years ago
You can use this with a partial file path too:
grunt jshint:core --file=wpview/plugin.js
#8
@
11 years ago
Updated to include that you can also use parts of the file path and to include an an example of that.
Thanks Netweb,
I think this is a docs issue. Using filter on jshint:core only filters files that are found using the core task (which is non external files that live in the src directory). I've uploaded a simple patch to hopefully make this a little clearer.
The docs team may have a better idea for how to describe this.