Skip to content
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

Removed --source, -S CLI flag. Fixes #937 #1215

Merged
merged 3 commits into from
Feb 2, 2017
Merged

Removed --source, -S CLI flag. Fixes #937 #1215

merged 3 commits into from
Feb 2, 2017

Conversation

LasaleFamine
Copy link
Contributor

Removed every reference within lib/cli.js. Replaced the reference for the Watcher constructor with conf.source.

I don't know if I need to write some tests or there are other references to remove, I tried to check what seemed more relevant.

@LasaleFamine
Copy link
Contributor Author

Dunno why node 4 on Travis timed-out... 😕

@sindresorhus
Copy link
Member

There are more places that needs updating (Use Ack or The Silver Searcher):

~/dev/ava master
❯ ag '\--source'
docs/recipes/watch-mode.md
70:You can configure patterns for the source files in the [`ava` section of your `package.json`] file, using the `source` key. This is the recommended way, though you could also use the [`--source` CLI flag].
74:If your tests write to disk they may trigger the watcher to rerun your tests. If this occurs you will need to use the `--source` flag.
116:[`--source` CLI flag]: https://github.com/avajs/ava#cli

readme.md
164:    --source, -S            Pattern to match source files so tests can be re-run (Can be repeated)

test/cli.js
241:	const child = execCli(['--verbose', '--watch', '--source=source.js', 'test-*.js'], {dirname: 'fixture/watcher/with-dependencies'}, err => {

@LasaleFamine
Copy link
Contributor Author

Thanks for the tip. I will be back later today.

Copy link
Member

@novemberborn novemberborn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for picking this up @LasaleFamine. I've just got some comments around the documentation.


You can specify patterns to match files in the folders that would otherwise be ignored, e.g. use `node_modules/some-dependency/*.js` to specify all `.js` files in `node_modules/some-dependency` as a source, even though normally all files in `node_modules` are ignored. Note that you need to specify an exact directory; `{bower_components,node_modules}/**/*.js` won't work.

If your tests write to disk they may trigger the watcher to rerun your tests. If this occurs you will need to use the `--source` flag.
If your tests write to disk they may trigger the watcher to rerun your tests.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add:

Configure patterns for the source files to avoid this.

readme.md Outdated
},
"devDependencies": {
"ava": "^0.17.0"
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you undo the whitespace changes in this file? Your editor may be doing it automatically but the only change that should be here is removing the --source flag.

@LasaleFamine
Copy link
Contributor Author

LasaleFamine commented Feb 1, 2017

I don't know why all those changes on the README. I think now is fixed.
Let me know if I need to change something more.

@sindresorhus sindresorhus merged commit 34bebc4 into avajs:master Feb 2, 2017
@sindresorhus
Copy link
Member

Nice work @LasaleFamine. Thanks for contributing :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants