on master help sign in
build requirements: add a shell script static analysis tool
bdf3920Markus Heiser
Makefile+4−2
@@ -70,12 +70,14 @@ $(GH_PAGES)::
70# test
70# test
71# ----
71# ----
72
72
73−PHONY += test test.pylint test.pep8 test.unit test.robot
73+PHONY += test test.sh test.pylint test.pep8 test.unit test.robot
74
74
75# TODO: balance linting with pylint
75# TODO: balance linting with pylint
76−test: test.pep8 test.unit test.robot
76+test: test.pep8 test.unit test.sh test.robot
77 - make pylint
77 - make pylint
78
78
79+test.sh:
80+
79test.pep8: pyenvinstall
81test.pep8: pyenvinstall
80 $(PY_ENV_ACT); ./manage.sh pep8_check
82 $(PY_ENV_ACT); ./manage.sh pep8_check
81
83
docs/admin/buildhosts.rst+41−9
@@ -35,8 +35,17 @@ processing additional packages are needed. The XeTeX_ needed not only for PDF
35creation, its also needed for :ref:`math` when HTML output is build.
35creation, its also needed for :ref:`math` when HTML output is build.
36
36
37To be able to do :ref:`sphinx:math-support` without CDNs, the math are rendered
37To be able to do :ref:`sphinx:math-support` without CDNs, the math are rendered
38−as images (``sphinx.ext.imgmath`` extension). If your docs build (``make
38+as images (``sphinx.ext.imgmath`` extension).
39+
40+Here is the extract from the :origin:`docs/conf.py` file, setting math renderer
41+to ``imgmath``:
42+
43+.. literalinclude:: ../conf.py
44+ :language: python
45+ :start-after: # sphinx.ext.imgmath setup
46+ :end-before: # sphinx.ext.imgmath setup END
47+
39−docs``) shows warnings like this::
48+If your docs build (``make docs``) shows warnings like this::
40
49
41 WARNING: dot(1) not found, for better output quality install \
50 WARNING: dot(1) not found, for better output quality install \
42 graphviz from http://www.graphviz.org
51 graphviz from http://www.graphviz.org
@@ -47,8 +56,6 @@ docs``) shows warnings like this::
47you need to install additional packages on your build host, to get better HTML
56you need to install additional packages on your build host, to get better HTML
48output.
57output.
49
58
50−.. _system requirements:
51−
52.. tabs::
59.. tabs::
53
60
54 .. group-tab:: Ubuntu / debian
61 .. group-tab:: Ubuntu / debian
@@ -94,10 +101,35 @@ For PDF output you also need:
94 texlive-collection-fontsrecommended texlive-collection-latex \
101 texlive-collection-fontsrecommended texlive-collection-latex \
95 dejavu-sans-fonts dejavu-serif-fonts dejavu-sans-mono-fonts
102 dejavu-sans-fonts dejavu-serif-fonts dejavu-sans-mono-fonts
96
103
97−.. _system requirements END:
104+.. _sh lint:
98
105
99−.. literalinclude:: ../conf.py
106+Lint shell scripts
100− :language: python
107+==================
101− :start-after: # sphinx.ext.imgmath setup
108+
102− :end-before: # sphinx.ext.imgmath setup END
109+.. _ShellCheck: https://github.com/koalaman/shellcheck
110+
111+To lint shell scripts, we use ShellCheck_ - A shell script static analysis tool.
112+
113+.. SNIP sh lint requirements
114+
115+.. tabs::
116+
117+ .. group-tab:: Ubuntu / debian
118+
119+ .. code-block:: sh
120+
121+ $ sudo apt install shellcheck
122+
123+ .. group-tab:: Arch Linux
124+
125+ .. code-block:: sh
126+
127+ $ sudo pacman -S shellcheck
128+
129+ .. group-tab:: Fedora / RHEL
130+
131+ .. code-block:: sh
132+
133+ $ sudo dnf install ShellCheck
103
134
135+.. SNAP sh lint requirements
docs/dev/makefile.rst+3−1
@@ -11,6 +11,8 @@ Makefile Targets
11 Before looking deeper at the targets, first read about :ref:`makefile setup`
11 Before looking deeper at the targets, first read about :ref:`makefile setup`
12 and :ref:`make pyenv`.
12 and :ref:`make pyenv`.
13
13
14+ To install system requirements follow :ref:`buildhosts`.
15+
14With the aim to simplify development cycles, started with :pull:`1756` a
16With the aim to simplify development cycles, started with :pull:`1756` a
15``Makefile`` based boilerplate was added. If you are not familiar with
17``Makefile`` based boilerplate was added. If you are not familiar with
16Makefiles, we recommend to read gnu-make_ introduction.
18Makefiles, we recommend to read gnu-make_ introduction.
@@ -170,7 +172,7 @@ e.g.:
170
172
171.. code:: sh
173.. code:: sh
172
174
173− $ make test.pep8 test.unit
175+ $ make test.pep8 test.unit test.sh
174 . ./local/py3/bin/activate; ./manage.sh pep8_check
176 . ./local/py3/bin/activate; ./manage.sh pep8_check
175 [!] Running pep8 check
177 [!] Running pep8 check
176 . ./local/py3/bin/activate; ./manage.sh unit_tests
178 . ./local/py3/bin/activate; ./manage.sh unit_tests
docs/dev/reST.rst+2−3
@@ -1312,9 +1312,8 @@ others are basic-tabs_ and code-tabs_. Below a *group-tab* example from
1312
1312
1313.. literalinclude:: ../admin/buildhosts.rst
1313.. literalinclude:: ../admin/buildhosts.rst
1314 :language: reST
1314 :language: reST
1315− :start-after: .. _system requirements:
1315+ :start-after: .. SNIP sh lint requirements
1316− :end-before: .. _system requirements END:
1316+ :end-before: .. SNAP sh lint requirements
1317−
1318
1317
1319.. _math:
1318.. _math:
1320
1319