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

Fix issue of non-reseting prefixes #183

Conversation

bgriffith
Copy link
Member

Fixes an issue where any modification to the prefixes array when testing using assertions gets carried across to the next. The issue is fixed by always setting the initial prefixes each time an assertion is run.

Closes #182

DCO 1.1 Signed-off-by: Ben Griffith [email protected]

@DanPurdy
Copy link
Member

I'm not sure about this.. We are adding extra steps to the linter to fix issues with our tests, this seems completely backwards to me, we should alter the way tests are set and run rather than modify the listing functionality?

@bgriffith
Copy link
Member Author

This only resets the prefixes for the rule. Assertions shouldn't be modifying code for the next one. Each assertion should have equal conditions.

I noticed this issue when I create another assertion using the defaults and received a different amount of warnings compared to the first time it had run.

@DanPurdy
Copy link
Member

As we just discussed, I don't think the prefixes should be set within the module itself, though having the default prefixes as immutable within is good and a copy of this array should be the one we mutate. This will prevent the problem in the tests and also be just general good practice..

@bgriffith
Copy link
Member Author

Yep agreed! Update pushed.

@bgriffith bgriffith added this to the 1.3.0 milestone Sep 18, 2015
@bgriffith
Copy link
Member Author

Going to tighten this up further.

@bgriffith bgriffith mentioned this pull request Sep 21, 2015
41 tasks
@DanPurdy
Copy link
Member

Yeah this makes sense. 👍

DanPurdy added a commit that referenced this pull request Sep 22, 2015
…new-assertion

Fix issue of non-reseting prefixes
@DanPurdy DanPurdy merged commit 69bf761 into sasstools:develop Sep 22, 2015
@bgriffith bgriffith deleted the feature/reset-prefix-array-on-new-assertion branch September 24, 2015 22:25
donabrams pushed a commit to donabrams/sass-lint that referenced this pull request Nov 19, 2015
…array-on-new-assertion

Fix issue of non-reseting prefixes
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.

Prefixes array being passed between assertions (no-vendor-prefixes)
2 participants