ansible-review icon indicating copy to clipboard operation
ansible-review copied to clipboard

WARN: Couldn't classify file tox.ini

Open vmindru opened this issue 6 years ago • 2 comments

Regarding "WARN: Couldn't classify file", quick look at candidate = classify(filename) and classify function make's me understand that if a file is not classified in the classify it's determined as None , as result ansible-review will always return a WARN for such files.

Should it have a mechanism to provide FILE we can ignore. Path ignore mechanism already exists for ansible-lint, i think ansible-review should use similar approach or use the existing config.

vmindru avatar Jan 23 '18 15:01 vmindru

as alternative simply change the warn to info.

diff --git a/lib/ansiblereview/__main__.py b/lib/ansiblereview/__main__.py
index c04f077..42b849d 100755
--- a/lib/ansiblereview/__main__.py
+++ b/lib/ansiblereview/__main__.py
@@ -94,5 +94,5 @@ def main():
                 info("Reviewing all of %s" % candidate, options)
             errors = errors + candidate.review(options, lines)
         else:
-            warn("Couldn't classify file %s" % filename, options)
+            info("Couldn't classify file %s" % filename, options)
     return errors

vmindru avatar Jan 23 '18 15:01 vmindru

@willthames let me know your opinion on this one, i Would go with change of the error to INFO it should not be a problem to have "alien" files in one's repo enforcing those to be "somehow" classified or "excluded" seems like too much hassle.

vmindru avatar Jan 23 '18 15:01 vmindru