add flake8 to the linter job
Turn on flake8 for code style checks, like in our other repos. Fix or explicitly ignore various issues to allow the linter job to pass. Change-Id: I7bfd8cf5e9c00dfa83c0393a4307fd54d2113047 Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
parent
446fc28df7
commit
1c98c456b5
@ -19,6 +19,7 @@ import re
|
|||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
from docutils.parsers.rst import directives
|
from docutils.parsers.rst import directives
|
||||||
from docutils.parsers.rst.directives import tables
|
from docutils.parsers.rst.directives import tables
|
||||||
|
from docutils.utils import SystemMessagePropagation
|
||||||
|
|
||||||
import projects
|
import projects
|
||||||
|
|
||||||
@ -40,9 +41,6 @@ class ExtraATCsTable(tables.Table):
|
|||||||
}
|
}
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
env = self.state.document.settings.env
|
|
||||||
app = env.app
|
|
||||||
|
|
||||||
project = self.options.get('project')
|
project = self.options.get('project')
|
||||||
if not project:
|
if not project:
|
||||||
error = self.state_machine.reporter.error(
|
error = self.state_machine.reporter.error(
|
||||||
|
@ -14,9 +14,9 @@
|
|||||||
Generate badges for the projects
|
Generate badges for the projects
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
|
||||||
from itertools import chain
|
from itertools import chain
|
||||||
from itertools import zip_longest
|
from itertools import zip_longest
|
||||||
|
import os
|
||||||
|
|
||||||
from PIL import ImageFont
|
from PIL import ImageFont
|
||||||
|
|
||||||
@ -155,6 +155,7 @@ def _organize_badges(badges):
|
|||||||
result[y].append(badge)
|
result[y].append(badge)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
def _to_svg(badges):
|
def _to_svg(badges):
|
||||||
for badge in badges:
|
for badge in badges:
|
||||||
yield FLAT_BADGE_TEMPLATE.format(**badge)
|
yield FLAT_BADGE_TEMPLATE.format(**badge)
|
||||||
|
@ -16,8 +16,9 @@
|
|||||||
import re
|
import re
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
from docutils.parsers.rst.directives import tables
|
|
||||||
from docutils.parsers.rst import directives
|
from docutils.parsers.rst import directives
|
||||||
|
from docutils.parsers.rst.directives import tables
|
||||||
|
from docutils.utils import SystemMessagePropagation
|
||||||
|
|
||||||
# Full name (IRC nickname) [expires in] {role}
|
# Full name (IRC nickname) [expires in] {role}
|
||||||
_PATTERN = re.compile('(?P<name>.*)\s+\((?P<irc>.*)\)\s+\[(?P<date>.*)\](\s+\{(?P<role>.*)\})?')
|
_PATTERN = re.compile('(?P<name>.*)\s+\((?P<irc>.*)\)\s+\[(?P<date>.*)\](\s+\{(?P<role>.*)\})?')
|
||||||
@ -61,7 +62,6 @@ class MembersTable(tables.Table):
|
|||||||
def run(self):
|
def run(self):
|
||||||
env = self.state.document.settings.env
|
env = self.state.document.settings.env
|
||||||
app = env.app
|
app = env.app
|
||||||
config = app.config
|
|
||||||
|
|
||||||
# The required argument to the directive is the name of the
|
# The required argument to the directive is the name of the
|
||||||
# file to parse.
|
# file to parse.
|
||||||
@ -146,6 +146,7 @@ class MembersTable(tables.Table):
|
|||||||
|
|
||||||
return table
|
return table
|
||||||
|
|
||||||
|
|
||||||
def setup(app):
|
def setup(app):
|
||||||
app.info('loading members extension')
|
app.info('loading members extension')
|
||||||
app.add_directive('memberstable', MembersTable)
|
app.add_directive('memberstable', MembersTable)
|
||||||
|
@ -11,6 +11,8 @@
|
|||||||
# All configuration values have a default; values that are commented out
|
# All configuration values have a default; values that are commented out
|
||||||
# serve to show the default.
|
# serve to show the default.
|
||||||
|
|
||||||
|
# flake8: noqa
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import csv
|
import csv
|
||||||
import sys
|
|
||||||
|
|
||||||
with open('defcore.csv', 'r') as infile:
|
with open('defcore.csv', 'r') as infile:
|
||||||
reader = csv.reader(infile)
|
reader = csv.reader(infile)
|
||||||
|
@ -15,3 +15,6 @@ source-dir = doc/source
|
|||||||
|
|
||||||
[pbr]
|
[pbr]
|
||||||
warnerrors = True
|
warnerrors = True
|
||||||
|
|
||||||
|
[flake8]
|
||||||
|
ignore = E501,E226,H405
|
@ -5,3 +5,4 @@ PyYAML>=3.1.0
|
|||||||
yamllint>=0.5.2
|
yamllint>=0.5.2
|
||||||
requests-cache
|
requests-cache
|
||||||
Pillow>=2.4.0 # PIL License
|
Pillow>=2.4.0 # PIL License
|
||||||
|
hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0
|
||||||
|
@ -29,7 +29,7 @@ def main():
|
|||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
'build the "Project Teams" section of a goal document',
|
'build the "Project Teams" section of a goal document',
|
||||||
)
|
)
|
||||||
args = parser.parse_args()
|
parser.parse_args()
|
||||||
|
|
||||||
print('Paste this output to the end of the goals file:\n')
|
print('Paste this output to the end of the goals file:\n')
|
||||||
|
|
||||||
|
@ -120,6 +120,7 @@ def get_core_reviews_by_company(group):
|
|||||||
|
|
||||||
return companies
|
return companies
|
||||||
|
|
||||||
|
|
||||||
@_memoize
|
@_memoize
|
||||||
def get_diversity_stats(project):
|
def get_diversity_stats(project):
|
||||||
team_stats = {}
|
team_stats = {}
|
||||||
|
4
tox.ini
4
tox.ini
@ -12,11 +12,13 @@ deps = -r{toxinidir}/test-requirements.txt
|
|||||||
|
|
||||||
[testenv:linters]
|
[testenv:linters]
|
||||||
whitelist_externals = bash
|
whitelist_externals = bash
|
||||||
commands = bash -c "find {toxinidir} \
|
commands =
|
||||||
|
bash -c "find {toxinidir} \
|
||||||
\( -name .tox -prune \) \
|
\( -name .tox -prune \) \
|
||||||
-o -type f -name '*.yaml' \
|
-o -type f -name '*.yaml' \
|
||||||
-print0 | xargs -0 yamllint"
|
-print0 | xargs -0 yamllint"
|
||||||
{toxinidir}/tools/check_projects_yaml_alphabetized.sh
|
{toxinidir}/tools/check_projects_yaml_alphabetized.sh
|
||||||
|
flake8
|
||||||
|
|
||||||
[testenv:venv]
|
[testenv:venv]
|
||||||
commands = {posargs}
|
commands = {posargs}
|
||||||
|
Loading…
Reference in New Issue
Block a user