Add Coala linting 23/57823/1
authorDaniel Farrell <dfarrell@redhat.com>
Thu, 25 May 2017 16:23:55 +0000 (12:23 -0400)
committerDaniel Farrell <dfarrell@redhat.com>
Thu, 25 May 2017 16:23:55 +0000 (12:23 -0400)
Some sections are disabled, will enable and fix in follow-up patches.

Change-Id: Ic4e2c75a95abf2b297f7f0ebe3f19d00f100d51b
Signed-off-by: Daniel Farrell <dfarrell@redhat.com>
.coafile [new file with mode: 0644]
tox.ini

diff --git a/.coafile b/.coafile
new file mode 100644 (file)
index 0000000..5e29469
--- /dev/null
+++ b/.coafile
@@ -0,0 +1,46 @@
+[default]
+ignore = .tox/**, .git/**, .gitignore, .gitreview, **.log,
+    node_modules/**, **.sw?, **.orig, **/.vagrant**
+
+[git]
+bears = GitCommitBear
+ignore_length_regex = Signed-off-by,
+    Also-by,
+    Co-authored-by,
+
+[spacing]
+bears = SpaceConsistencyBear
+use_spaces = True
+enforce_newline_at_EOF = False
+files = **
+default_actions = SpaceConsistencyBear: ApplyPatchAction
+
+[linelength]
+bears = LineLengthBear
+enabled = False
+max_line_length = 100
+
+[markdown]
+bears = MarkdownBear
+enabled = False
+files = **.markdown, **.md
+default_actions = MarkdownBear: ApplyPatchAction
+
+[rest]
+bears = RSTcheckBear, reSTLintBear
+files = **.rst
+
+[yaml]
+bears = YAMLLintBear
+yamllint_config = .yamllint
+files = **.yaml, **.yml
+
+[json]
+bears = JSONFormatBear
+files = **.json
+default_actions = JSONFormatBear: ApplyPatchAction
+
+[xml]
+bears = XMLBear
+enabled = False
+files = **.xml
diff --git a/tox.ini b/tox.ini
index 9197d2f5d02d8804b75a4e4999dbd6674fe8149e..7b797b13cfe81cb30d3516da4f1d042f23a7b44d 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -1,8 +1,20 @@
 [tox]
 minversion = 1.6.0
-envlist = lint
+envlist = coala, ansible-lint
 skipsdist = true
 
-[testenv:lint]
+[testenv:ansible-lint]
 deps = ansible-lint
 commands = ansible-lint examples/all_defaults_playbook.yml
+
+[testenv:coala]
+basepython = python3
+deps =
+    coala==0.11
+    coala-bears==0.11
+    nodeenv
+commands =
+    nodeenv -p
+    npm install --global dockerfile_lint remark-cli remark-lint
+    python3 -m nltk.downloader punkt maxent_treebank_pos_tagger averaged_perceptron_tagger
+    coala --non-interactive