forked from openedx/edx-platform
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lint Sass files using the rules in stylelint-config-edx
Fixes
- Loading branch information
1 parent
76d3b62
commit e5cab61
Showing
8 changed files
with
116 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
""" | ||
Tests for Paver's Stylelint tasks. | ||
""" | ||
import ddt | ||
from mock import MagicMock, patch | ||
from paver.easy import call_task | ||
|
||
from .utils import PaverTestCase | ||
|
||
|
||
@ddt.ddt | ||
class TestPaverStylelint(PaverTestCase): | ||
""" | ||
Tests for Paver's Stylelint tasks. | ||
""" | ||
|
||
def setUp(self): | ||
super(TestPaverStylelint, self).setUp() | ||
pass | ||
|
||
@ddt.data( | ||
[0, False], | ||
[99, False], | ||
[100, True], | ||
) | ||
@ddt.unpack | ||
def test_run_stylelint(self, violations_limit, should_pass): | ||
""" | ||
Verify that the quality task fails with Stylelint violations. | ||
""" | ||
_mock_stylelint_violations = MagicMock(return_value=100) | ||
with patch('pavelib.quality._get_stylelint_violations', _mock_stylelint_violations): | ||
if should_pass: | ||
call_task('pavelib.quality.run_stylelint', options={"limit": violations_limit}) | ||
else: | ||
with self.assertRaises(SystemExit): | ||
call_task('pavelib.quality.run_stylelint', options={"limit": violations_limit}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
extends: '@edx/stylelint-config-edx' | ||
}; |