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
feat: add include
and exclude
options to instrument command
#1007
feat: add include
and exclude
options to instrument command
#1007
Commits on Mar 1, 2019
-
Added
include
andexclude
options for instrument commandThis allows you to better select which files are instrumented when running the instrument command. It's a pretty minimal implementation to make it as easy as possible to integrate with other proposed changes. Test support is included with this change.
Andrew Finlay committedMar 1, 2019
Commits on Mar 7, 2019
-
Merge branch 'master' into instrument-include-exclude-option
# Conflicts: # lib/commands/instrument.js
Andrew Finlay committedMar 7, 2019
Commits on Mar 11, 2019
-
Merge branch 'master' into instrument-include-exclude-option
# Conflicts: # lib/commands/instrument.js
Andrew Finlay committedMar 11, 2019
Commits on Mar 20, 2019
-
Merge branch 'master' into instrument-include-exclude-option
# Conflicts: # index.js # lib/commands/instrument.js # test/nyc-integration.js
Andrew Finlay committedMar 20, 2019 -
nyc instrument
copies all files to an output directory, then adds i……nstrumented versions where needed So I've implemented this using `fs-extra`, not sure if that's the module you wish to go with here. This is now relying on `testExclude.globSync` to get the correct files for instrumentation, so no more `shouldInstrument` There's quite a few test changes in here, as `fs-extra.copySync` won't let you copy from `./` to `./outputMkdirHere`, but they're probably for the best anyway. This also means that any attempt to store the instrumentation result in a subdir of the input dir will fail.
Andrew Finlay committedMar 20, 2019 -
Use
var cov_
rather than_cov
in testsAndrew Finlay committedMar 20, 2019
Commits on Mar 22, 2019
-
nyc instrument now copies all files, with permissions, from
input
t……o `output` dir It ignores files in the `.git` folder and copies empty directories Unfortunately I had to keep `fs-extra`, although this should be easy to drop when the project moves to node 8+ when `fs.copyFileSync` is made available. We need to use `fs.chmodSync` to set the mode as any `write` mode flags get filtered when trying to set them through `fs.writeFileSync`. What's missing? * No check to see where the working directory is relative to the project root directory * Tests confirming includes/excludes can be set in a config file or stanza and are observed by the instrument command * Tests confirming file permissions match between files in the input and output directories * Tests confirming we can't instrument outside of the project root directory
Andrew Finlay committedMar 22, 2019
Commits on Mar 25, 2019
-
Update tests, prevent in place instrumentation and instrumentation ou…
…tside of cwd Tests include * using a `.nycrc` file to specify excludes * checking that file mode is preserved after instrumentation, * copying all uninstrumented files across to the output directory * Ensure that we can't instrument in place, overwriting the existing source * Ensure that we can't instrument source from outside the project root directory
Andrew Finlay committedMar 25, 2019 -
A file `node_modules` file involved in the tests was being git ignored
Andrew Finlay committedMar 25, 2019 -
Ignore file permissions test if running on Windows
Andrew Finlay committedMar 25, 2019 -
Use process.platform instead of os.platform
Andrew Finlay committedMar 25, 2019
Commits on Mar 28, 2019
-
Merge branch 'master' into instrument-include-exclude-option
# Conflicts: # index.js
Andrew Finlay committedMar 28, 2019
Commits on Apr 2, 2019
-
Clean up copy remaining files for nyc instrument command
In the last attempt at this I was jumping through hoops trying to maintain empty folders and structure etc. Turns out none of that is necessary. So this change runs the instrumentation process over the included files, then copies across anything remaining excluding freshly created output directory.
Andrew Finlay committedApr 2, 2019 -
Make sure we can instrument the root directory
And a test to prove it!
Andrew Finlay committedApr 2, 2019 -
Merge in master, update test title
Andrew Finlay committedApr 2, 2019
Commits on Apr 3, 2019
-
Merge branch 'master' into instrument-include-exclude-option
Andrew Finlay committedApr 3, 2019
Commits on Apr 4, 2019
-
Split PR such that this only handles `nyc instrument --include --excl…
…ude` Previously this was adding `nyc instrument` full copy of `src` to `dst` as well as `include`/`exclude` The full copy work was proving troublesome so it's been moved to it's own branch/PR This commit removes the full copy, removes now unused dependencies, and updates tests accordingly
Andrew Finlay committedApr 4, 2019