From b2f7abc5e5a00db1658dd04d8ed96059dff70eb0 Mon Sep 17 00:00:00 2001 From: Andrew Grimberg Date: Wed, 3 May 2017 14:49:44 -0400 Subject: [PATCH] Add configuration in prep to enable coala and tox * Configure the .gitignore in prepration for coala lint checking and tox driven tests * Add needed configuration files for driving tox based tests including coala lint validation checks Issue: CIMAN-2 Change-Id: I41746a251ca0ca95c681426a2f5cd3474de425e6 Signed-off-by: Andrew Grimberg --- .coafile | 33 +++++++++++++++++++++++++++++++++ .editorconfig | 25 +++++++++++++++++++++++++ .gitignore | 5 +++++ tox.ini | 21 +++++++++++++++++++++ yamllint.conf | 8 ++++++++ 5 files changed, 92 insertions(+) create mode 100644 .coafile create mode 100644 .editorconfig create mode 100644 tox.ini create mode 100644 yamllint.conf diff --git a/.coafile b/.coafile new file mode 100644 index 000000000..3f6f8f4b6 --- /dev/null +++ b/.coafile @@ -0,0 +1,33 @@ +[GitCommit] +bears = GitCommitBear +ignore_length_regex = Signed-off-by, + Also-by, + Co-authored-by, + http://, + https:// + +[JSON] +bears = JSONFormatBear +files = **/*.json +ignore = .*/** +indent_size = 2 + +[YAML] +bears = YAMLLintBear +files = jjb/**/*.yaml +document_start = True +yamllint_config = yamllint.conf + +[ShellCheck] +bears = ShellCheckBear,SpaceConsistencyBear +files = jenkins-scripts/**/*.sh, + jjb/**/*.sh, + scripts/**/*.sh +ignore = jenkins-scripts/*-local-env.sh, + jjb/global-jjb/shell/*.sh, + jjb/include-docker-push.sh, + jjb/include-update-pom-versions.sh, + jjb/testsuite/testsuite-docker.sh, +shell = bash +indent_size = 4 +use_spaces = yeah diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..5eb4e678e --- /dev/null +++ b/.editorconfig @@ -0,0 +1,25 @@ +root = true + +[*] +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +indent_style = space + +[*.json] +indent_size = 2 + +[*.rst] +indent_size = 4 + +[*.markdown] +indent_size = 4 +max_line_length = 80 + +[*.sh] +indent_size = 4 +max_line_length = 80 + +[*.yaml] +indent_size = 4 + diff --git a/.gitignore b/.gitignore index f4cd20b9b..e824ce3fc 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,8 @@ target/ # Eclipse .project /.pydevproject + +# Python +.tox/ +__pycache__/ +*.pyc diff --git a/tox.ini b/tox.ini new file mode 100644 index 000000000..dbeedd8bd --- /dev/null +++ b/tox.ini @@ -0,0 +1,21 @@ +[tox] +minversion = 1.6 +envlist = coala,docs,pep8 +skipsdist = true + +[testenv:coala] +basepython = python3 +deps = + coala + coala-bears +commands = + python3 -m nltk.downloader punkt maxent_treebank_pos_tagger averaged_perceptron_tagger + coala --non-interactive + +# [testenv:docs] +# deps = sphinx +# commands = sphinx-build -b html -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/html + +[testenv:pep8] +deps = flake8 +commands = flake8 scripts/ diff --git a/yamllint.conf b/yamllint.conf new file mode 100644 index 000000000..32d76ab6e --- /dev/null +++ b/yamllint.conf @@ -0,0 +1,8 @@ +extends: default + +rules: + empty-lines: + max-end: 1 + line-length: + max: 120 + -- 2.16.6