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

Throw error on non-existent files unless allow-empty-input is enabled #3965

Conversation

3 participants
@Bilie
Copy link
Contributor

commented Feb 25, 2019

Closes #3880

@Bilie Bilie requested review from davidtheclark and jeddy3 Feb 25, 2019

@jeddy3
Copy link
Member

left a comment

@Bilie Thanks for doing this. It's looking good.

I have a query about the wording of the error message.


This is a breaking change, as should be within a major release.

Major releases can be tricky as most plugins with peer dependencies have to release new versions. @stylelint/core Do we release regardless?

@@ -191,8 +191,11 @@ describe("extending config with ignoreFiles glob ignoring one by negation", () =
});

describe("specified `ignorePath` file ignoring one file", () => {
let results;
const noFilesErrorMessage = new Error(
"The specified `files` glob returns no results"

This comment has been minimized.

Copy link
@jeddy3

jeddy3 Feb 26, 2019

Member

Shall we adopt the ESLint approach of?:

No files matching the pattern "${pattern}" were found.

This feels a little more explicit as we're stating the glob pattern in the error message, rather than just referring to it.

Bilie added some commits Feb 27, 2019

@jeddy3

This comment has been minimized.

Copy link
Member

commented Apr 2, 2019

With talk of a major release in #4000, I think we can get this in?

@jeddy3 jeddy3 referenced this pull request Apr 2, 2019

Closed

Release 10.0.0 #3954

6 of 6 tasks complete
@hudochenkov
Copy link
Member

left a comment

Thank you for working on this!

I just have two small change requests.

Show resolved Hide resolved lib/cli.js Outdated
@@ -14,6 +14,7 @@ const globby /*: Function*/ = require("globby");
const hash = require("./utils/hash");
const ignore = require("ignore");
const needlessDisables /*: Function*/ = require("./needlessDisables");
const NoFilesFoundError = require("./testUtils/noFilesFoundError");

This comment has been minimized.

Copy link
@hudochenkov

hudochenkov Apr 3, 2019

Member

I think noFilesFoundError should be in lib/utils directory, because it's a part of application.

config: configBlockNoEmpty
})
.then(() => {
throw new Error("should not have succeeded");

This comment has been minimized.

Copy link
@hudochenkov

hudochenkov Apr 3, 2019

Member

I'm just curious why to throw an error here? Isn't stylelint should throw an error and catch will catch it?

This comment has been minimized.

Copy link
@Bilie

Bilie Apr 11, 2019

Author Contributor

Hi, I removed this, it was left over from testing

@hudochenkov hudochenkov removed the request for review from davidtheclark Apr 3, 2019

@jeddy3

This comment has been minimized.

Copy link
Member

commented Apr 4, 2019

@hudochenkov Good catches!

@jeddy3

This comment has been minimized.

Copy link
Member

commented Apr 11, 2019

@Bilie Do you think you'll have time to look into @hudochenkov suggestions before the weekend? We're planning to release 10.0.0 then.

hudochenkov and others added some commits Apr 11, 2019

Fix typo in lib/cli.js
Co-Authored-By: Bilie <bilianavaleva@gmail.com>
@Bilie

This comment has been minimized.

Copy link
Contributor Author

commented Apr 11, 2019

Hi, thank you for the feedback! I have updated the PR, let me know if you spot anything else.

@hudochenkov
Copy link
Member

left a comment

Thank you for addressing feedback!

One last thing. I believe all throw new Error("should not have succeeded"); in ignore.test.js are also unnecessary for tests.

Bilie added some commits Apr 12, 2019

@hudochenkov

This comment has been minimized.

Copy link
Member

commented Apr 12, 2019

Look awesome! Thanks, @Bilie!

@jeddy3

jeddy3 approved these changes Apr 13, 2019

@jeddy3 jeddy3 merged commit 4ca75e7 into stylelint:master Apr 13, 2019

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage decreased (-0.006%) to 96.372%
Details
@jeddy3

This comment has been minimized.

Copy link
Member

commented Apr 13, 2019

  • Changed: throws error if glob matches no files, use the --allow-empty-input flag for the old behaviour (#3965).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.