Report: Add data
[csit.git] / tox.ini
1 # Copyright (c) 2020 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13
14 # Idea of this file is motivated by OpenDylight,
15 # especially its Integration/Test sub-project.
16
17 # This file requires active virtualenv with tox package installed,
18 # or python-tox system package installed.
19
20 # Usage:
21 # cd to CSIT root (other directories might use different tox.ini)
22 #   $ tox
23 # will execute all checks.
24 #  $ tox -e pylint
25 # will execute only checks defined in "pylint" tox environment.
26
27 [tox]
28 # Fast and brief checkers to front, slow or verbose checkers to back.
29 envlist = tc_naming, tc_coverage, copyright_year, gpl_license, new_line_length,
30     line_length, autogen, pylint, doc_verify
31
32 # The following is needed as tox requires setup.py by default.
33 skipsdist = true
34 # Just a shorthand to avoid long lines.
35 checker_dir = ./resources/libraries/bash/entry/check
36
37 # TODO: Tox prints various warnings. Figure them out and fix them.
38
39 # Keep testenvs sorted alphabetically, please.
40
41 [testenv:autogen]
42 whitelist_externals = /bin/bash
43 setenv = PYTHONPATH = {toxinidir}
44 commands = bash {[tox]checker_dir}/autogen.sh
45
46 [testenv:copyright_year]
47 whitelist_externals = /bin/bash
48 setenv = PYTHONPATH = {toxinidir}
49 commands = bash {[tox]checker_dir}/copyright_year.sh
50
51 [testenv:doc_verify]
52 # Fix all documentaion error before enabling voting.
53 whitelist_externals = /bin/bash
54 commands = bash -c "bash {[tox]checker_dir}/doc_verify.sh || true"
55
56 [testenv:gpl_license]
57 whitelist_externals = /bin/bash
58 setenv = PYTHONPATH = {toxinidir}
59 commands = bash {[tox]checker_dir}/gpl_license.sh
60
61 [testenv:line_length]
62 whitelist_externals = /bin/bash
63 # Fix all transgressions and remove the " || true" workaround.
64 commands = bash -c "bash {[tox]checker_dir}/line.sh || true"
65
66 [testenv:new_line_length]
67 whitelist_externals = /bin/bash
68 # Adding .svg, big .rst tables, .yaml and similar still requires long lines.
69 # As current implementation is too dumb to filter those out,
70 # the checker has to remain non-voting.
71 commands = bash -c "bash {[tox]checker_dir}/new_line.sh || true"
72
73 [testenv:pylint]
74 basepython = python3
75 deps =
76     pylint==2.4.3
77     -r ./requirements.txt
78 whitelist_externals = /bin/bash
79 setenv = PYTHONPATH = {toxinidir}
80 # Run pylint, but hide its return value until python warnings are cleared.
81 commands = bash -c "bash {[tox]checker_dir}/pylint.sh || true"
82
83 # TODO: See FIXME in https://gerrit.fd.io/r/16423
84
85 [testenv:tc_coverage]
86 whitelist_externals = /bin/bash
87 # Coverage is not needed to be voting.
88 commands = bash -c "bash {[tox]checker_dir}/tc_coverage.sh || true"
89
90 [testenv:tc_naming]
91 whitelist_externals = /bin/bash
92 commands = bash {[tox]checker_dir}/tc_naming.sh
93
94 # Keep testenvs sorted alphabetically, please.
95
96 # TODO: Add a checker against unresolved merge conflicts.
97 #       See: https://gerrit.fd.io/r/c/vpp/+/26956
98 # TODO: Create voting "pylint violations should not increase" checker.
99 # TODO: Create voting checker to reject suites with Force Tags of other suite.
100 # TODO: Create voting checker against tags not in tag_documentation.rst file.
101 # TODO: Create Robot suite Documentation checker (backslash if not next mark).
102 # TODO: Create .yaml specific checker, so people can override long line check.
103 # TODO: Create .rst specific checker, if there is one allowing
104 #       to override line check.
105 # TODO: You get the idea, replace line check with something smarter
106 #       wherever possible.