You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+10-2Lines changed: 10 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,7 @@ code-notes is based on two npm modules, mainly forked from [fixme](https://githu
7
7
- Flexibility in defining the source scanning directory
8
8
- The ability to pass exclude patterns that are compatible with [multimatch](https://github.com/sindresorhus/multimatch)
9
9
- The ability to read exclusion list from a `.gitignore` file
10
+
- The ability to include **only** certain path patterns to be scanned
10
11
11
12
It ends up giving you an output like this:
12
13
@@ -38,6 +39,7 @@ notes --help
38
39
-s, --source [dir] root directory to be included only for checks (default: current working directory)
39
40
-x, --patterns [dir] Path patterns to exclude (default: include all files and directories)
40
41
-e, --encoding [type] file encoding to be scanned (default: utf8)
42
+
-i, --include [dir] Path patterns to include only (default: include all files and directories). Note that include patterns will overwrite any exclude patterns
41
43
-l, --line-length <n> number of max characters a line (default: 1000)
-g, --git-ignore <n> ignore patterns from your .gitignore file. This paramter accepts the path for the .gitIgnore file (default: false | no .gitignore is read
@@ -47,6 +49,7 @@ notes --help
47
49
48
50
***source:** The path to scan through for notes, defaults to process.cwd()
49
51
***patterns:** Glob patterns for files directories to ignore. Passes these straight to [multimatch](https://github.com/sindresorhus/multimatch) so check there for more information on proper syntax.
52
+
***include** Glob patterns for files or directories to be inlucded **ONLY** in the scan process. Note that any include files will overwrite any exclude patterns
50
53
***ignoreHidden:** Define if you want to ignore hidden files and directories. Defaults to true as all paths will be scanned.
51
54
***encoding:** The encoding the files scanned will be opened as.
52
55
***lineLength:** The number of max characters a line can be before Fixme gives up and doen not scan it for matches. If a line is too long, the regular expression will take an extremely long time to finish. *You have been warned!*
@@ -112,8 +115,12 @@ Those comments would be annotated as:
112
115
notes -g .gitignore -h true
113
116
# Exclude any file under the src directory and node_modules and any file with .md extension
114
117
notes -x src/ -x -x node_modules/ -x *.md
118
+
# Only scan .md files
119
+
notes -i "*.md"
115
120
```
116
121
122
+
> **Important**: For some reason that i still cant figure out, some extensions like `.md``.html` have to be wrapped with `"`. So if your pattern does not seem to work at first, try to wrap it with quotes
123
+
117
124
### Extending code-notes
118
125
119
126
code-notes scan for NOTE, OPTIMIZE, TODO, HACK, XXX, FIXME, and BUG comments within your source, and print them to stdout so you can deal with them. However, if you wish to define more annotations to be extracted, this can be easily done by extending the definitions in `lib/messageChecks.js`. An example for an annotation:
@@ -128,10 +135,11 @@ todo: {
128
135
129
136
#### Ignoring files
130
137
131
-
Certain file extensions are skipped from being scanned. They are defined in `lib/notes.js`
138
+
Certain file extensions and directories are skipped from being scanned. They are defined in `lib/notes.js`
.option('-i, --include [dir]','Path patterns to include only (default: include all files and directories). Note that include patterns will overwrite any exclude patterns',
0 commit comments