[dev-gnome-web] manage: Add coala subcommand



commit d109dc9e7110f55def4bd4fab57e8b35d0245696
Author: Lasse Schuirmann <lasse schuirmann gmail com>
Date:   Thu Jan 28 12:18:42 2016 +0100

    manage: Add coala subcommand

 manage.py |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/manage.py b/manage.py
index adfbc7a..45fa939 100755
--- a/manage.py
+++ b/manage.py
@@ -4,6 +4,8 @@
 This is an application management application that allows to run the server.
 """
 
+from subprocess import call
+
 from flask_script import Manager
 
 from server.app import app
@@ -11,5 +13,21 @@ from server.app import app
 manager = Manager(app)
 
 
+ manager command
+def coala(noninteractive=False):
+    """
+    Runs code analysis on the application.
+
+    :param noninteractive: True if no interactions are to be done. (JSON
+    output will be generated in this case.)
+    :return: 0 if all is well.
+    """
+    if noninteractive:
+        return call(['coala-format', '-S', 'format_str={origin}, {file}, from '
+                                           '{line} to {end_line}. {message}'])
+    else:
+        return call('coala')
+
+
 if __name__ == '__main__':
     manager.run()


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]