File tree 7 files changed +47
-19
lines changed
7 files changed +47
-19
lines changed Original file line number Diff line number Diff line change 10
10
needs-python : ${{ true }}
11
11
needs-node : ${{ false }}
12
12
- name : Lint
13
- command : make lint BINDIR="$(dirname $(which python))"
13
+ command : bin/ lint
14
14
needs-python : ${{ true }}
15
- needs-node : ${{ true }}
15
+ needs-node : ${{ false }}
16
16
- name : Documentation
17
17
command : make docs BINDIR="$(dirname $(which python))"
18
18
needs-python : ${{ true }}
33
33
command : bin/static_tests
34
34
needs-python : ${{ false }}
35
35
needs-node : ${{ true }}
36
+ - name : Static Lint
37
+ command : bin/static_lint
38
+ needs-python : ${{ false }}
39
+ needs-node : ${{ true }}
36
40
- name : Static Pipeline
37
41
command : bin/static_pipeline
38
42
needs-python : ${{ false }}
Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ RUN set -x \
111
111
install --no-binary hiredis \
112
112
-r /tmp/requirements/deploy.txt \
113
113
-r /tmp/requirements/main.txt \
114
- $(if [ "$DEVEL" = "yes" ]; then echo '-r /tmp/requirements/tests.txt' ; fi) \
114
+ $(if [ "$DEVEL" = "yes" ]; then echo '-r /tmp/requirements/tests.txt -r /tmp/requirements/lint.txt ' ; fi) \
115
115
$(if [ "$THEME_REPO" != "" ]; then echo '-r /tmp/requirements/theme.txt' ; fi) \
116
116
&& find /opt/warehouse -name '*.pyc' -delete
117
117
Original file line number Diff line number Diff line change @@ -105,22 +105,10 @@ reformat: .state/env/pyvenv.cfg
105
105
$(BINDIR ) /isort * .py warehouse/ tests/
106
106
$(BINDIR ) /black * .py warehouse/ tests/
107
107
108
- lint : .state/env/pyvenv.cfg
109
- $(BINDIR ) /flake8 .
110
- $(BINDIR ) /black --check * .py warehouse/ tests/
111
- $(BINDIR ) /isort --check * .py warehouse/ tests/
112
- $(BINDIR ) /doc8 --allow-long-titles README.rst CONTRIBUTING.rst docs/ --ignore-path docs/_build/
113
- $(BINDIR ) /curlylint ./warehouse/templates
114
-
115
- ifneq ($(filter false,$(TRAVIS ) $(GITHUB_ACTIONS ) ) ,)
116
- # We're either on Travis or GitHub Actions, so we can lint static files locally
117
- ./node_modules/.bin/eslint 'warehouse/static/js/**' '**.js' 'tests/frontend/**' --ignore-pattern 'warehouse/static/js/vendor/**'
118
- ./node_modules/.bin/sass-lint --verbose
119
- else
120
- # We're not on Travis or GitHub Actions, so we should lint static files inside the static container
121
- docker-compose run --rm static ./node_modules/.bin/eslint 'warehouse/static/js/**' '**.js' 'tests/frontend/**' --ignore-pattern 'warehouse/static/js/vendor/**'
122
- docker-compose run --rm static ./node_modules/.bin/sass-lint --verbose
123
- endif
108
+ lint : .state/docker-build
109
+ docker-compose run --rm web env -i ENCODING=" C.UTF-8" \
110
+ PATH=" /opt/warehouse/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" \
111
+ bin/lint && bin/static_lint
124
112
125
113
docs : .state/env/pyvenv.cfg
126
114
$(MAKE ) -C docs/ doctest SPHINXOPTS=" -W" SPHINXBUILD=" $( BINDIR) /sphinx-build"
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -e
3
+
4
+ # Click requires us to ensure we have a well configured environment to run
5
+ # our click commands. So we'll set our environment to ensure our locale is
6
+ # correct.
7
+ export LC_ALL=" ${ENCODING:- en_US.UTF-8} "
8
+ export LANG=" ${ENCODING:- en_US.UTF-8} "
9
+
10
+ COMMAND_ARGS=$@
11
+
12
+ # Print all the followng commands
13
+ set -x
14
+
15
+ # Actually run our tests.
16
+ python -m flake8 .
17
+ python -m black --check * .py warehouse/ tests/
18
+ python -m isort --check * .py warehouse/ tests/
19
+ python -m doc8 --allow-long-titles README.rst CONTRIBUTING.rst docs/ --ignore-path docs/_build/
20
+ python -m curlylint ./warehouse/templates
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -e
3
+ set -x
4
+
5
+ # Click requires us to ensure we have a well configured environment to run
6
+ # our click commands. So we'll set our environment to ensure our locale is
7
+ # correct.
8
+ export LC_ALL=" ${ENCODING:- en_US.UTF-8} "
9
+ export LANG=" ${ENCODING:- en_US.UTF-8} "
10
+
11
+ # Actually run our tests.
12
+ ./node_modules/.bin/eslint ' warehouse/static/js/**' ' **.js' ' tests/frontend/**' --ignore-pattern ' warehouse/static/js/vendor/**'
13
+ ./node_modules/.bin/sass-lint --verbose
Original file line number Diff line number Diff line change @@ -85,6 +85,7 @@ services:
85
85
- ./htmlcov:/opt/warehouse/src/htmlcov:z
86
86
- .coveragerc:/opt/warehouse/src/.coveragerc:z
87
87
- packages:/var/opt/warehouse/packages
88
+ - ./bin:/opt/warehouse/src/bin:z
88
89
ports :
89
90
- " 80:8000"
90
91
Original file line number Diff line number Diff line change @@ -2,3 +2,5 @@ hupper>=1.9
2
2
pip-api
3
3
pip-tools>=1.0
4
4
pyramid_debugtoolbar>=2.5
5
+ -r tests.in
6
+ -r lint.in
You can’t perform that action at this time.
0 commit comments