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

'merge-default-rules: false' ignored when set in config and not in options #278

Closed
benthemonkey opened this issue Oct 9, 2015 · 11 comments
Assignees
Labels

Comments

@benthemonkey
Copy link
Member

This is a really easy bug to fix.

This line: https://github.com/sasstools/sass-lint/blob/develop/lib/config.js#L77

should simply be an else.

I'll add a test for this and fix the issue.

@DanPurdy
Copy link
Member

DanPurdy commented Oct 9, 2015

Nice one, If 1.3.0 is out by the time you get to this would your mind running this off the master branch? I think it warrants a hotfix.

Thanks!

@DanPurdy DanPurdy added the bug label Oct 10, 2015
@benthemonkey
Copy link
Member Author

Lol, the tests for config aren't actually testing anything.

See here?
https://github.com/sasstools/sass-lint/blob/develop/tests/config.js#L37

equal isn't an assertion. You don't actually test if equal returns true.

@benthemonkey
Copy link
Member Author

Update: It wasn't at all as simple as I thought it would be. I found many issues with the CLI tests, and by fixing those issues I think I'm causing some tests to fail. Not entirely sure.

Let me work on it a little bit more, and I'll ask for some help if I can't figure things out.

@DanPurdy
Copy link
Member

Gah... my mind's gone.. I've fixed this small issue in a PR, for some reason it didn't register that I'd already read this somewhere as it was reported on my atom plugin and I went hunting!

I've left it as an else if just for specificity sake (open else's are evil?) but once you're happy with the tests on this run it straight into a PR for the develop branch or I can take over if you're getting bogged down on it? I'm just hoping to release this fix with 1.3.1 as it's probably leading to quite a few issues currently.

@benthemonkey
Copy link
Member Author

No problem! I wasn't sure when I'd be able to get around to it. However, I don't think the problem is correctly fixed by your PR. If merge-default-rules is false, then none of the other options from the config file get merged, right?

See what I ended up doing: benthemonkey@e35e2b4

@DanPurdy
Copy link
Member

Hmm, I see what you mean.. I think what you had makes sense, will re look at it later on.

@DanPurdy
Copy link
Member

So i just had a look at this, i think my PR should fix the issue. If merge-default-rule:false is set in your custom config then the default rules should be completely ignored yes.

This custom config then essentially becomes the default rules. If you pass extra options through with merge default set to true then your extra options will either merge or overwrite your custom rules.

Are you seeing this as working differently?

@benthemonkey
Copy link
Member Author

I agree that it fixes the issue about rules. What it doesn't do is fix the related issue of options not getting merged from config when merge-default-rules is false. If merge-default-rules is false but formatter is json (in config), sass-lint wont respect that, or any other option settings other than merge-default-rules: false.

@DanPurdy
Copy link
Member

Ah yes, I see what you mean, if you set merge-default-rules to false it ignores your custom options however if you completely remove merge-default-rules it works fine..

@DanPurdy DanPurdy self-assigned this Oct 17, 2015
@DanPurdy
Copy link
Member

Ok this went out with 1.3.1. #318 I'm happy to tackle the test refactoring next.

@benthemonkey
Copy link
Member Author

#310 Looks great! Closing.

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

No branches or pull requests

2 participants