Skip to content

Commit ffca1ae

Browse files
committed
Many linting and code quality changes
1 parent d2d1344 commit ffca1ae

2 files changed

Lines changed: 71 additions & 75 deletions

File tree

docs/_theme/flask_theme_support.py

Lines changed: 63 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -17,73 +17,73 @@
1717

1818

1919
class FlaskyStyle(Style):
20-
background_color = "#f8f8f8"
21-
default_style = ""
20+
background_color = '#f8f8f8'
21+
default_style = ''
2222

2323
styles = {
2424
# No corresponding class for the following:
25-
# Text: "", # class: ''
26-
Whitespace: "underline #f8f8f8", # class: 'w'
27-
Error: "#a40000 border:#ef2929", # class: 'err'
28-
Other: "#000000", # class 'x'
29-
Comment: "italic #8f5902", # class: 'c'
30-
Comment.Preproc: "noitalic", # class: 'cp'
31-
Keyword: "bold #004461", # class: 'k'
32-
Keyword.Constant: "bold #004461", # class: 'kc'
33-
Keyword.Declaration: "bold #004461", # class: 'kd'
34-
Keyword.Namespace: "bold #004461", # class: 'kn'
35-
Keyword.Pseudo: "bold #004461", # class: 'kp'
36-
Keyword.Reserved: "bold #004461", # class: 'kr'
37-
Keyword.Type: "bold #004461", # class: 'kt'
38-
Operator: "#582800", # class: 'o'
39-
Operator.Word: "bold #004461", # class: 'ow' - like keywords
40-
Punctuation: "bold #000000", # class: 'p'
25+
# Text: '', # class: ''
26+
Whitespace: 'underline #f8f8f8', # class: 'w'
27+
Error: '#a40000 border:#ef2929', # class: 'err'
28+
Other: '#000000', # class 'x'
29+
Comment: 'italic #8f5902', # class: 'c'
30+
Comment.Preproc: 'noitalic', # class: 'cp'
31+
Keyword: 'bold #004461', # class: 'k'
32+
Keyword.Constant: 'bold #004461', # class: 'kc'
33+
Keyword.Declaration: 'bold #004461', # class: 'kd'
34+
Keyword.Namespace: 'bold #004461', # class: 'kn'
35+
Keyword.Pseudo: 'bold #004461', # class: 'kp'
36+
Keyword.Reserved: 'bold #004461', # class: 'kr'
37+
Keyword.Type: 'bold #004461', # class: 'kt'
38+
Operator: '#582800', # class: 'o'
39+
Operator.Word: 'bold #004461', # class: 'ow' - like keywords
40+
Punctuation: 'bold #000000', # class: 'p'
4141
# because special names such as Name.Class, Name.Function, etc.
4242
# are not recognized as such later in the parsing, we choose them
4343
# to look the same as ordinary variables.
44-
Name: "#000000", # class: 'n'
45-
Name.Attribute: "#c4a000", # class: 'na' - to be revised
46-
Name.Builtin: "#004461", # class: 'nb'
47-
Name.Builtin.Pseudo: "#3465a4", # class: 'bp'
48-
Name.Class: "#000000", # class: 'nc' - to be revised
49-
Name.Constant: "#000000", # class: 'no' - to be revised
50-
Name.Decorator: "#888", # class: 'nd' - to be revised
51-
Name.Entity: "#ce5c00", # class: 'ni'
52-
Name.Exception: "bold #cc0000", # class: 'ne'
53-
Name.Function: "#000000", # class: 'nf'
54-
Name.Property: "#000000", # class: 'py'
55-
Name.Label: "#f57900", # class: 'nl'
56-
Name.Namespace: "#000000", # class: 'nn' - to be revised
57-
Name.Other: "#000000", # class: 'nx'
58-
Name.Tag: "bold #004461", # class: 'nt' - like a keyword
59-
Name.Variable: "#000000", # class: 'nv' - to be revised
60-
Name.Variable.Class: "#000000", # class: 'vc' - to be revised
61-
Name.Variable.Global: "#000000", # class: 'vg' - to be revised
62-
Name.Variable.Instance: "#000000", # class: 'vi' - to be revised
63-
Number: "#990000", # class: 'm'
64-
Literal: "#000000", # class: 'l'
65-
Literal.Date: "#000000", # class: 'ld'
66-
String: "#4e9a06", # class: 's'
67-
String.Backtick: "#4e9a06", # class: 'sb'
68-
String.Char: "#4e9a06", # class: 'sc'
69-
String.Doc: "italic #8f5902", # class: 'sd' - like a comment
70-
String.Double: "#4e9a06", # class: 's2'
71-
String.Escape: "#4e9a06", # class: 'se'
72-
String.Heredoc: "#4e9a06", # class: 'sh'
73-
String.Interpol: "#4e9a06", # class: 'si'
74-
String.Other: "#4e9a06", # class: 'sx'
75-
String.Regex: "#4e9a06", # class: 'sr'
76-
String.Single: "#4e9a06", # class: 's1'
77-
String.Symbol: "#4e9a06", # class: 'ss'
78-
Generic: "#000000", # class: 'g'
79-
Generic.Deleted: "#a40000", # class: 'gd'
80-
Generic.Emph: "italic #000000", # class: 'ge'
81-
Generic.Error: "#ef2929", # class: 'gr'
82-
Generic.Heading: "bold #000080", # class: 'gh'
83-
Generic.Inserted: "#00A000", # class: 'gi'
84-
Generic.Output: "#888", # class: 'go'
85-
Generic.Prompt: "#745334", # class: 'gp'
86-
Generic.Strong: "bold #000000", # class: 'gs'
87-
Generic.Subheading: "bold #800080", # class: 'gu'
88-
Generic.Traceback: "bold #a40000", # class: 'gt'
44+
Name: '#000000', # class: 'n'
45+
Name.Attribute: '#c4a000', # class: 'na' - to be revised
46+
Name.Builtin: '#004461', # class: 'nb'
47+
Name.Builtin.Pseudo: '#3465a4', # class: 'bp'
48+
Name.Class: '#000000', # class: 'nc' - to be revised
49+
Name.Constant: '#000000', # class: 'no' - to be revised
50+
Name.Decorator: '#888', # class: 'nd' - to be revised
51+
Name.Entity: '#ce5c00', # class: 'ni'
52+
Name.Exception: 'bold #cc0000', # class: 'ne'
53+
Name.Function: '#000000', # class: 'nf'
54+
Name.Property: '#000000', # class: 'py'
55+
Name.Label: '#f57900', # class: 'nl'
56+
Name.Namespace: '#000000', # class: 'nn' - to be revised
57+
Name.Other: '#000000', # class: 'nx'
58+
Name.Tag: 'bold #004461', # class: 'nt' - like a keyword
59+
Name.Variable: '#000000', # class: 'nv' - to be revised
60+
Name.Variable.Class: '#000000', # class: 'vc' - to be revised
61+
Name.Variable.Global: '#000000', # class: 'vg' - to be revised
62+
Name.Variable.Instance: '#000000', # class: 'vi' - to be revised
63+
Number: '#990000', # class: 'm'
64+
Literal: '#000000', # class: 'l'
65+
Literal.Date: '#000000', # class: 'ld'
66+
String: '#4e9a06', # class: 's'
67+
String.Backtick: '#4e9a06', # class: 'sb'
68+
String.Char: '#4e9a06', # class: 'sc'
69+
String.Doc: 'italic #8f5902', # class: 'sd' - like a comment
70+
String.Double: '#4e9a06', # class: 's2'
71+
String.Escape: '#4e9a06', # class: 'se'
72+
String.Heredoc: '#4e9a06', # class: 'sh'
73+
String.Interpol: '#4e9a06', # class: 'si'
74+
String.Other: '#4e9a06', # class: 'sx'
75+
String.Regex: '#4e9a06', # class: 'sr'
76+
String.Single: '#4e9a06', # class: 's1'
77+
String.Symbol: '#4e9a06', # class: 'ss'
78+
Generic: '#000000', # class: 'g'
79+
Generic.Deleted: '#a40000', # class: 'gd'
80+
Generic.Emph: 'italic #000000', # class: 'ge'
81+
Generic.Error: '#ef2929', # class: 'gr'
82+
Generic.Heading: 'bold #000080', # class: 'gh'
83+
Generic.Inserted: '#00A000', # class: 'gi'
84+
Generic.Output: '#888', # class: 'go'
85+
Generic.Prompt: '#745334', # class: 'gp'
86+
Generic.Strong: 'bold #000000', # class: 'gs'
87+
Generic.Subheading: 'bold #800080', # class: 'gu'
88+
Generic.Traceback: 'bold #a40000', # class: 'gt'
8989
}

docs/conf.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,14 @@
6161
# General information about the project.
6262
project = u'Progress Bar'
6363
project_slug = ''.join(project.capitalize().split())
64-
copyright = u'%s, <a href="http://wol.ph/">%s</a>' % (
65-
datetime.date.today().year,
66-
metadata.__author__,
67-
)
64+
copyright = f'{datetime.date.today().year}, <a href="http://wol.ph/">{metadata.__author__}</a>'
6865

6966
# The version info for the project you're documenting, acts as replacement for
7067
# |version| and |release|, also used in various other places throughout the
7168
# built documents.
7269
#
7370
# The short X.Y version.
7471
version = metadata.__version__
75-
assert version == '4.3b0', version
7672
# The full version, including alpha/beta/rc tags.
7773
release = metadata.__version__
7874

@@ -191,7 +187,7 @@
191187
# html_file_suffix = None
192188

193189
# Output file base name for HTML help builder.
194-
htmlhelp_basename = '%sdoc' % project_slug
190+
htmlhelp_basename = f'{project_slug}doc'
195191

196192

197193
# -- Options for LaTeX output --------------------------------------------
@@ -210,11 +206,11 @@
210206
latex_documents = [
211207
(
212208
'index',
213-
'%s.tex' % project_slug,
214-
u'%s Documentation' % project,
209+
f'{project_slug}.tex',
210+
f'{project} Documentation',
215211
metadata.__author__,
216212
'manual',
217-
),
213+
)
218214
]
219215

220216
# The name of an image file (relative to this directory) to place at the top of
@@ -246,7 +242,7 @@
246242
(
247243
'index',
248244
project_slug.lower(),
249-
u'%s Documentation' % project,
245+
f'{project} Documentation',
250246
[metadata.__author__],
251247
1,
252248
)
@@ -265,12 +261,12 @@
265261
(
266262
'index',
267263
project_slug,
268-
u'%s Documentation' % project,
264+
f'{project} Documentation',
269265
metadata.__author__,
270266
project_slug,
271267
'One line description of project.',
272268
'Miscellaneous',
273-
),
269+
)
274270
]
275271

276272
# Documents to append as an appendix to all manuals.

0 commit comments

Comments
 (0)