Add configuration in prep to enable coala and tox 65/3865/2
authorAndrew Grimberg <agrimberg@linuxfoundation.org>
Wed, 3 May 2017 18:49:44 +0000 (14:49 -0400)
committerAndrew Grimberg <agrimberg@linuxfoundation.org>
Wed, 3 May 2017 19:58:48 +0000 (15:58 -0400)
* 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 <agrimberg@linuxfoundation.org>
.coafile [new file with mode: 0644]
.editorconfig [new file with mode: 0644]
.gitignore
tox.ini [new file with mode: 0644]
yamllint.conf [new file with mode: 0644]

diff --git a/.coafile b/.coafile
new file mode 100644 (file)
index 0000000..3f6f8f4
--- /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 (file)
index 0000000..5eb4e67
--- /dev/null
@@ -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
+
index f4cd20b..e824ce3 100644 (file)
@@ -23,3 +23,8 @@ target/
 # Eclipse
 .project
 /.pydevproject
+
+# Python
+.tox/
+__pycache__/
+*.pyc
diff --git a/tox.ini b/tox.ini
new file mode 100644 (file)
index 0000000..dbeedd8
--- /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 (file)
index 0000000..32d76ab
--- /dev/null
@@ -0,0 +1,8 @@
+extends: default
+
+rules:
+  empty-lines:
+    max-end: 1
+  line-length:
+    max: 120
+