1 # Copyright (c) 2021 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:
6 # http://www.apache.org/licenses/LICENSE-2.0
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.
14 # Idea of this file is motivated by OpenDylight,
15 # especially its Integration/Test sub-project.
17 # This file requires active virtualenv with tox package installed,
18 # or python-tox system package installed.
21 # cd to CSIT root (other directories might use different tox.ini)
23 # will execute all checks.
25 # will execute only checks defined in "pylint" tox environment.
28 # Fast and brief checkers to front, slow or verbose checkers to back.
29 envlist = job_spec, copyright_year, gpl_license,
30 new_line_length, line_length, autogen, pylint, doc_verify
32 # The following is needed as tox requires setup.py by default.
34 # Just a shorthand to avoid long lines.
35 checker_dir = ./resources/libraries/bash/entry/check
37 # TODO: Tox prints various warnings. Figure them out and fix them.
39 # Recommended ordering withinn testenv definition:
41 # + ignore_outcome for non-voting checkers,
42 # + setenv (PYTHONPATH) for Python-using checkers.
43 # + Other Python stuff (e.g. basepython and deps for pylint).
44 # + whitelist_externals to enable bash.
45 # + commands with a single bash to launch the corresponding checker script.
47 # Keep testenvs sorted alphabetically, please.
50 setenv = PYTHONPATH = {toxinidir}
51 whitelist_externals = /bin/bash
52 commands = bash {[tox]checker_dir}/autogen.sh
54 [testenv:copyright_year]
55 whitelist_externals = /bin/bash
56 commands = bash {[tox]checker_dir}/copyright_year.sh
59 # Fix all documentation error before enabling voting.
61 whitelist_externals = /bin/bash
62 commands = bash {[tox]checker_dir}/doc_verify.sh
65 whitelist_externals = /bin/bash
66 commands = bash {[tox]checker_dir}/gpl_license.sh
70 whitelist_externals = /bin/bash
71 commands = bash {[tox]checker_dir}/job_spec.sh
74 # Fix all transgressions and remove the ignore_outcome flag.
76 whitelist_externals = /bin/bash
77 commands = bash {[tox]checker_dir}/line.sh
79 [testenv:new_line_length]
80 # Adding .svg, big .rst tables, .yaml and similar still requires long lines.
81 # As current implementation is too dumb to filter those out,
82 # the checker has to remain non-voting.
84 whitelist_externals = /bin/bash
85 commands = bash {[tox]checker_dir}/new_line.sh
88 # Run pylint, but hide its return value until python warnings are cleared.
90 setenv = PYTHONPATH = {toxinidir}
95 whitelist_externals = /bin/bash
96 commands = bash {[tox]checker_dir}/pylint.sh
98 # Keep testenvs sorted alphabetically, please.
100 # TODO: Add a checker against unresolved merge conflicts.
101 # See: https://gerrit.fd.io/r/c/vpp/+/26956
102 # TODO: Create voting "pylint violations should not increase" checker.
103 # TODO: Create voting checker to reject suites with Force Tags of other suite.
104 # TODO: Create voting checker against tags not in tag_documentation.rst file.
105 # TODO: Create Robot suite Documentation checker (backslash if not next mark).
106 # TODO: Create .yaml specific checker, so people can override long line check.
107 # TODO: Create .rst specific checker, if there is one allowing
108 # to override line check.
109 # TODO: You get the idea, replace line check with something smarter