Skip to content

Conversation

henrahmagix
Copy link

If given a path to a file that doesn't exist, sass-lint should throw an
error to let the user know it cannot find the config file. Otherwise the
user will have no idea that the default config is being used and theirs
is being ignored.

When not given a config path, continue as usual: return an empty config.

This also fixes relative path issues in the failures test suite.


What do the changes you have made achieve?

They let the user know if the given path to a config file does not exist instead of silently returning an empty config.

Are there any new warning messages?

Yes: 1 new Error thrown.

> confHelpers.loadConfig('notexist.yml')
Error: Cannot find configPath notexist.yml
    at [stack trace...]

Have you written tests?

Yes, and fixed the config file paths in tests/failures.js.

Have you included relevant documentation

No: I think the error thrown should be the natural result of giving an incorrect filepath, rather than a "new feature".

Which issues does this resolve?

Fixes #1006

<DCO 1.1 Signed-off-by: Henry Blyth <[email protected]>

If given a path to a file that doesn't exist, sass-lint should throw an
error to let the user know it cannot find the config file. Otherwise the
user will have no idea that the default config is being used and theirs
is being ignored.

When not given a config path, continue as usual: return an empty config.

This also fixes relative path issues in the failures test suite.
@coveralls
Copy link

coveralls commented Jan 30, 2017

Coverage Status

Coverage increased (+0.001%) to 97.519% when pulling 45a2214 on henrahmagix:fail-for-config-not-found into d96ed96 on sasstools:develop.

@DanPurdy
Copy link
Member

Thanks for this PR, I'm not sure if the unhandled error throwing is really the way to go at the moment, let me run this and have a look at it.

@henrahmagix
Copy link
Author

Hi @DanPurdy,

Thanks for taking a look. What do you think now?

Cheers,
Henry

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

Successfully merging this pull request may close these issues.

User is not told if given config filepath does not exist and default rules are used instead
3 participants