From 5c486a878a0989f069e6366f9056206968526ca8 Mon Sep 17 00:00:00 2001 From: Simon Quigley Date: Fri, 19 Jun 2020 14:59:49 -0500 Subject: [PATCH] Delint everything, make tabs four spaces instead. --- .arclint | 7 +-- metrics | 8 ++-- modules/jenkins.py | 2 +- templates/index.html | 18 +++---- templates/jenkins.html | 106 ++++++++++++++++++++--------------------- 5 files changed, 67 insertions(+), 74 deletions(-) diff --git a/.arclint b/.arclint index 36d7633..a661aef 100644 --- a/.arclint +++ b/.arclint @@ -1,8 +1,9 @@ { - "exclude": "(^LICENSE)", + "exclude": "(^LICENSE|.gitignore)", "linters": { - "sample": { - "type": "flake8" + "python": { + "type": "flake8", + "exclude": "(\\.html$)" } } } diff --git a/metrics b/metrics index afdb30c..959ed35 100755 --- a/metrics +++ b/metrics @@ -117,19 +117,19 @@ if __name__ == "__main__": # Parse CLI arguments parser = argparse.ArgumentParser() parser.add_argument("--db-location", type=str, default=":memory:", - help="Specify the location for the SQLite database") + help="Specify the location for the SQLite database") parser.add_argument("--log", type=str, default="WARNING", - help="Default logging level") + help="Default logging level") args = parser.parse_args() # Ensure the logging level is set properly num_level = getattr(log, args.log.upper(), None) if not isinstance(num_level, int): - raise ValueError("Invalid log level: %s" % loglevel) + raise ValueError("Invalid log level: %s" % args.log) # Fully configure the logger log.basicConfig(format="%(asctime)s\t%(levelname)s\t%(message)s", - level=num_level) + level=num_level) # Initialize a dict to store data for the summary page summary_page = {} diff --git a/modules/jenkins.py b/modules/jenkins.py index cff5e06..68d5e87 100755 --- a/modules/jenkins.py +++ b/modules/jenkins.py @@ -188,7 +188,7 @@ class JenkinsModule: # Write it back to the filename in the output dir with open(path.join("output", "jenkins_%sdays.html" % days), - "w+") as f: + "w+") as f: f.write(template) # Return the averages for use in the summary diff --git a/templates/index.html b/templates/index.html index 52b0de2..b937b49 100644 --- a/templates/index.html +++ b/templates/index.html @@ -5,15 +5,11 @@ - +
-
-
-
-

Summary for Lubuntu Project Metrics

@@ -22,13 +18,13 @@

Jenkins Data

- +
- - - + + + @@ -37,9 +33,9 @@ {% for avg in page.Jenkins[day] %} - {% endfor %} + {% endfor %} - {% endfor %} + {% endfor %}
Time (days)Average FailingAverage Non-passingAverage TotalAverage FailingAverage Non-passingAverage Total
{{ day }}{{ avg }}
diff --git a/templates/jenkins.html b/templates/jenkins.html index f9ee53f..10e0a0e 100644 --- a/templates/jenkins.html +++ b/templates/jenkins.html @@ -8,15 +8,11 @@ - +
-
-
-
-

Jenkins data for the past {{ days }} day(s)

@@ -34,58 +30,58 @@ var myChart = new Chart(ctx, { type: 'line', data: { - datasets: [ - { - label: 'Failing Jobs', - backgroundColor: "#FF0000", - //borderColor: "#FF0000", - data: [ - {% for timestamp, num in jenkins.failing %} - { - t: new Date({{ timestamp }} * 1000), - y: {{ num }} - }, - {% endfor %} - ] - }, - { - label: 'Non-passing Jobs', - backgroundColor: "#FFFF00", - //borderColor: "#FFFF00", - data: [ - {% for timestamp, num in jenkins.nonpassing %} - { - t: new Date({{ timestamp }} * 1000), - y: {{ num }} - }, - {% endfor %} - ] - }, - { - label: 'Total Jobs', - backgroundColor: "#003A72", - //borderColor: "#003A72", - data: [ - {% for timestamp, num in jenkins.total %} - { - t: new Date({{ timestamp }} * 1000), - y: {{ num }} - }, - {% endfor %} - ] - }, - ] - }, - options: { - scales: { - xAxes: [{ - type: 'time', - time: { - unit: 'day' + datasets: [ + { + label: 'Failing Jobs', + backgroundColor: "#FF0000", + //borderColor: "#FF0000", + data: [ + {% for timestamp, num in jenkins.failing %} + { + t: new Date({{ timestamp }} * 1000), + y: {{ num }} + }, + {% endfor %} + ] + }, + { + label: 'Non-passing Jobs', + backgroundColor: "#FFFF00", + //borderColor: "#FFFF00", + data: [ + {% for timestamp, num in jenkins.nonpassing %} + { + t: new Date({{ timestamp }} * 1000), + y: {{ num }} + }, + {% endfor %} + ] + }, + { + label: 'Total Jobs', + backgroundColor: "#003A72", + //borderColor: "#003A72", + data: [ + {% for timestamp, num in jenkins.total %} + { + t: new Date({{ timestamp }} * 1000), + y: {{ num }} + }, + {% endfor %} + ] + }, + ] + }, + options: { + scales: { + xAxes: [{ + type: 'time', + time: { + unit: 'day' + } + }] } - }] } - } });