Skip to content
This repository has been archived by the owner on Apr 15, 2020. It is now read-only.

Commit

Permalink
Remove deprecated jscs linter
Browse files Browse the repository at this point in the history
  • Loading branch information
messense committed Jun 7, 2017
1 parent 7529114 commit 95380dc
Show file tree
Hide file tree
Showing 12 changed files with 7 additions and 105 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ RUN echo 'deb http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu xenial main' > /
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash - \
&& apt-get install -y nodejs \
&& npm install -g \
jscs eslint csslint sass-lint jsonlint stylelint \
eslint csslint sass-lint jsonlint stylelint \
eslint-plugin-react eslint-plugin-react-native \
babel-eslint

Expand Down
2 changes: 1 addition & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Vagrant.configure(2) do |config|
sudo apt-get install -y shellcheck
sudo pip install ipython ipdb virtualenv
sudo pip install -U -r /vagrant/dev-requirements.txt
sudo npm install -g jscs eslint csslint sass-lint jsonlint eslint-plugin-react eslint-plugin-react-native stylelint
sudo npm install -g eslint csslint sass-lint jsonlint eslint-plugin-react eslint-plugin-react-native stylelint
cd /vagrant && sudo python setup.py develop && cd -
SHELL
end
39 changes: 0 additions & 39 deletions badwolf/lint/linters/jscs.py

This file was deleted.

2 changes: 0 additions & 2 deletions badwolf/lint/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from badwolf.lint import Problems
from badwolf.lint.linters.eslint import ESLinter
from badwolf.lint.linters.flake8 import Flake8Linter
from badwolf.lint.linters.jscs import JSCSLinter
from badwolf.lint.linters.pep8 import PEP8Linter
from badwolf.lint.linters.csslint import CSSLinter
from badwolf.lint.linters.shellcheck import ShellCheckLinter
Expand All @@ -30,7 +29,6 @@ class LintProcessor(object):
LINTERS = {
'eslint': ESLinter,
'flake8': Flake8Linter,
'jscs': JSCSLinter,
'pep8': PEP8Linter,
'csslint': CSSLinter,
'shellcheck': ShellCheckLinter,
Expand Down
2 changes: 1 addition & 1 deletion docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Standalone 模式
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y software-properties-common python-dev python-software-properties python-setuptools python-pip git nodejs shellcheck
sudo npm install -g jscs eslint csslint sass-lint jsonlint eslint-plugin-react eslint-plugin-react-native
sudo npm install -g eslint csslint sass-lint jsonlint eslint-plugin-react eslint-plugin-react-native
然后使用 pip 安装 badwolf:

Expand Down
1 change: 0 additions & 1 deletion docs/lint.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ flake8 Python http://flake8.readthedocs.org/en/latest/
pep8 Python http://pep8.readthedocs.org/en/latest/
pylint Python http://pep8.readthedocs.org/en/latest/
bandit Python https://github.com/openstack/bandit
jscs JavaScript http://jscs.info/
eslint JavaScript http://eslint.org/
csslint CSS http://csslint.net/
stylelint CSS/SASS/SCSS http://stylelint.io/
Expand Down
2 changes: 1 addition & 1 deletion src.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ RUN echo 'deb http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu xenial main' > /
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash - \
&& apt-get install -y nodejs \
&& npm install -g \
jscs eslint csslint sass-lint jsonlint stylelint \
eslint csslint sass-lint jsonlint stylelint \
eslint-plugin-react eslint-plugin-react-native \
babel-eslint

Expand Down
2 changes: 1 addition & 1 deletion test.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ RUN echo 'deb http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu xenial main' > /
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash - \
&& apt-get install -y nodejs \
&& npm install -g \
jscs eslint csslint sass-lint jsonlint stylelint \
eslint csslint sass-lint jsonlint stylelint \
eslint-plugin-react eslint-plugin-react-native \
babel-eslint \
&& rm -rf /var/lib/apt/list/* /tmp/* /var/tmp/*
3 changes: 0 additions & 3 deletions tests/fixtures/jscs/.jscsrc

This file was deleted.

2 changes: 0 additions & 2 deletions tests/fixtures/jscs/a.js

This file was deleted.

51 changes: 0 additions & 51 deletions tests/test_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,57 +132,6 @@ def test_flake8_lint_a_py(app, caplog):
assert problem.line == 6


def test_jscs_lint_a_js(app, caplog):
diff = """diff --git a/.jscsrc b/.jscsrc
new file mode 100644
index 0000000..c287019
--- /dev/null
+++ b/.jscsrc
@@ -0,0 +1,3 @@
+{
+ "preset": "node-style-guide"
+}
\ No newline at end of file
diff --git a/jscs/a.js b/a.js
new file mode 100644
index 0000000..66f319a
--- /dev/null
+++ b/a.js
@@ -0,0 +1,2 @@
+var foo = 'bar';
+if(foo === 'bar') {}
"""

context = Context(
'deepanalyzer/badwolf',
None,
'pullrequest',
'message',
{'commit': {'hash': '000000'}},
{'commit': {'hash': '111111'}},
pr_id=1
)
spec = Specification()
spec.linters.append(ObjectDict(name='jscs', pattern=None))
lint = LintProcessor(context, spec, os.path.join(FIXTURES_PATH, 'jscs'))
patch = PatchSet(diff.split('\n'))
with mock.patch.object(lint, 'load_changes') as load_changes,\
mock.patch.object(lint, 'update_build_status') as build_status,\
mock.patch.object(lint, '_report') as report:
load_changes.return_value = patch
build_status.return_value = None
report.return_value = (1, 2)
lint.problems.set_changes(patch)
lint.process()

assert load_changes.called

assert len(lint.problems) == 1
problem = lint.problems[0]
assert problem.filename == 'a.js'
assert problem.line == 2


def test_eslint_lint_a_js(app, caplog):
diff = """diff --git a/.eslintrc b/.eslintrc
new file mode 100644
Expand Down
4 changes: 2 additions & 2 deletions tests/test_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,15 +262,15 @@ def test_parse_linter_with_pattern(app):
def test_parse_multi_linters_with_pattern(app):
s = """linter:
- {name: "flake8", pattern: "*.py"}
- jscs"""
- eslint"""
f = io.StringIO(s)
spec = Specification.parse_file(f)
assert len(spec.linters) == 2
linter0 = spec.linters[0]
assert linter0.name == 'flake8'
assert linter0.pattern == '*.py'
linter1 = spec.linters[1]
assert linter1.name == 'jscs'
assert linter1.name == 'eslint'
assert linter1.pattern is None


Expand Down

0 comments on commit 95380dc

Please sign in to comment.