Skip to content

Commit 2e86b48

Browse files
authored
Pre-commit with black, isort, spellcheck (#1652)
* expand pre-commit * apply pre-commit * remove line break artefacts * Fix test after spellcheck change
1 parent ac925db commit 2e86b48

80 files changed

Lines changed: 3686 additions & 2540 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.pre-commit-config.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,40 @@ repos:
2020
- id: flake8
2121
exclude: docs/conf.py
2222
args: [--max-line-length=120]
23+
24+
- repo: https://github.com/pycqa/isort
25+
rev: 5.10.1
26+
hooks:
27+
- id: isort
28+
additional_dependencies: [toml]
29+
args: ["--profile", "black", "--filter-files"]
30+
31+
- repo: https://github.com/psf/black
32+
rev: 22.10.0
33+
hooks:
34+
- id: black
35+
language_version: python3
36+
37+
- repo: https://github.com/keewis/blackdoc
38+
rev: v0.3.8
39+
hooks:
40+
- id: blackdoc
41+
42+
- repo: https://github.com/codespell-project/codespell
43+
rev: v2.2.2
44+
hooks:
45+
- id: codespell
46+
args:
47+
- --ignore-words-list=thex
48+
exclude: >
49+
(?x)^(
50+
.*\.csv |
51+
.*\.json |
52+
)$
53+
54+
- repo: https://github.com/asottile/pyupgrade
55+
rev: v3.2.0
56+
hooks:
57+
- id: pyupgrade
58+
args:
59+
- --py36-plus

docs/conf.py

Lines changed: 74 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -9,46 +9,46 @@
99
# All configuration values have a default; values that are commented out
1010
# serve to show the default.
1111

12-
import sys
1312
import os
13+
import sys
1414

1515
# Use the currently checked out folium of this folder
1616
sys.path.insert(0, os.path.abspath(os.pardir))
1717

1818
# If extensions (or modules to document with autodoc) are in another directory,
1919
# add these directories to sys.path here. If the directory is relative to the
2020
# documentation root, use os.path.abspath to make it absolute, like shown here.
21-
#sys.path.insert(0, os.path.abspath('.'))
21+
# sys.path.insert(0, os.path.abspath('.'))
2222

2323
# -- General configuration -----------------------------------------------------
2424

2525
# If your documentation needs a minimal Sphinx version, state it here.
26-
#needs_sphinx = '1.0'
26+
# needs_sphinx = '1.0'
2727

2828
# Add any Sphinx extension module names here, as strings. They can be extensions
2929
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
3030
extensions = [
31-
'sphinx.ext.autodoc',
32-
'sphinx.ext.napoleon',
33-
'nbsphinx',
34-
'sphinx.ext.intersphinx',
31+
"sphinx.ext.autodoc",
32+
"sphinx.ext.napoleon",
33+
"nbsphinx",
34+
"sphinx.ext.intersphinx",
3535
]
3636

3737
# Add any paths that contain templates here, relative to this directory.
38-
templates_path = ['_templates']
38+
templates_path = ["_templates"]
3939

4040
# The suffix of source filenames.
41-
source_suffix = '.rst'
41+
source_suffix = ".rst"
4242

4343
# The encoding of source files.
44-
#source_encoding = 'utf-8-sig'
44+
# source_encoding = 'utf-8-sig'
4545

4646
# The master toctree document.
47-
master_doc = 'index'
47+
master_doc = "index"
4848

4949
# General information about the project.
50-
project = 'Folium'
51-
copyright = '2013, Rob Story'
50+
project = "Folium"
51+
copyright = "2013, Rob Story"
5252

5353
# The version info for the project you're documenting, acts as replacement for
5454
# |version| and |release|, also used in various other places throughout the
@@ -57,178 +57,173 @@
5757
# The full version, including alpha/beta/rc tags.
5858

5959
import folium
60+
6061
version = release = folium.__version__
6162

6263
# The short X.Y version.
63-
version = '.'.join(release.split('.')[:2])
64+
version = ".".join(release.split(".")[:2])
6465

6566
# The language for content autogenerated by Sphinx. Refer to documentation
6667
# for a list of supported languages.
67-
#language = None
68+
# language = None
6869

6970
# There are two options for replacing |today|: either, you set today to some
7071
# non-false value, then it is used:
71-
#today = ''
72+
# today = ''
7273
# Else, today_fmt is used as the format for a strftime call.
73-
#today_fmt = '%B %d, %Y'
74+
# today_fmt = '%B %d, %Y'
7475

7576
# List of patterns, relative to source directory, that match files and
7677
# directories to ignore when looking for source files.
77-
exclude_patterns = ['_build']
78+
exclude_patterns = ["_build"]
7879

7980
# The reST default role (used for this markup: `text`) to use for all documents.
80-
#default_role = None
81+
# default_role = None
8182

8283
# If true, '()' will be appended to :func: etc. cross-reference text.
83-
#add_function_parentheses = True
84+
# add_function_parentheses = True
8485

8586
# If true, the current module name will be prepended to all description
8687
# unit titles (such as .. function::).
87-
#add_module_names = True
88+
# add_module_names = True
8889

8990
# If true, sectionauthor and moduleauthor directives will be shown in the
9091
# output. They are ignored by default.
91-
#show_authors = False
92+
# show_authors = False
9293

9394
# The name of the Pygments (syntax highlighting) style to use.
94-
pygments_style = 'sphinx'
95+
pygments_style = "sphinx"
9596

9697
# A list of ignored prefixes for module index sorting.
97-
#modindex_common_prefix = []
98+
# modindex_common_prefix = []
9899

99100

100101
# -- Options for HTML output ---------------------------------------------------
101102

102103
# The theme to use for HTML and HTML Help pages. See the documentation for
103104
# a list of builtin themes.
104-
html_theme = 'f6'
105+
html_theme = "f6"
105106

106107
# Theme options are theme-specific and customize the look and feel of a theme
107108
# further. For a list of options available for each theme, see the
108109
# documentation.
109-
#html_theme_options = {}
110+
# html_theme_options = {}
110111

111112
# Add any paths that contain custom themes here, relative to this directory.
112-
html_theme_path = ['_themes']
113+
html_theme_path = ["_themes"]
113114

114115
# The name for this set of Sphinx documents. If None, it defaults to
115116
# "<project> v<release> documentation".
116-
#html_title = None
117+
# html_title = None
117118

118119
# A shorter title for the navigation bar. Default is the same as html_title.
119-
#html_short_title = None
120+
# html_short_title = None
120121

121122
# The name of an image file (relative to this directory) to place at the top
122123
# of the sidebar.
123-
#html_logo = None
124+
# html_logo = None
124125

125126
# The name of an image file (within the static path) to use as favicon of the
126127
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
127128
# pixels large.
128-
#html_favicon = None
129+
# html_favicon = None
129130

130131
# Add any paths that contain custom static files (such as style sheets) here,
131132
# relative to this directory. They are copied after the builtin static files,
132133
# so a file named "default.css" will overwrite the builtin "default.css".
133-
html_static_path = ['_static']
134+
html_static_path = ["_static"]
134135

135136
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
136137
# using the given strftime format.
137-
#html_last_updated_fmt = '%b %d, %Y'
138+
# html_last_updated_fmt = '%b %d, %Y'
138139

139140
# If true, SmartyPants will be used to convert quotes and dashes to
140141
# typographically correct entities.
141-
#html_use_smartypants = True
142+
# html_use_smartypants = True
142143

143144
# Custom sidebar templates, maps document names to template names.
144-
#html_sidebars = {}
145+
# html_sidebars = {}
145146

146147
# Additional templates that should be rendered to pages, maps page names to
147148
# template names.
148-
#html_additional_pages = {}
149+
# html_additional_pages = {}
149150

150151
# If false, no module index is generated.
151-
#html_domain_indices = True
152+
# html_domain_indices = True
152153

153154
# If false, no index is generated.
154-
#html_use_index = True
155+
# html_use_index = True
155156

156157
# If true, the index is split into individual pages for each letter.
157-
#html_split_index = False
158+
# html_split_index = False
158159

159160
# If true, links to the reST sources are added to the pages.
160-
#html_show_sourcelink = True
161+
# html_show_sourcelink = True
161162

162163
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
163-
#html_show_sphinx = True
164+
# html_show_sphinx = True
164165

165166
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
166-
#html_show_copyright = True
167+
# html_show_copyright = True
167168

168169
# If true, an OpenSearch description file will be output, and all pages will
169170
# contain a <link> tag referring to it. The value of this option must be the
170171
# base URL from which the finished HTML is served.
171-
#html_use_opensearch = ''
172+
# html_use_opensearch = ''
172173

173174
# This is the file name suffix for HTML files (e.g. ".xhtml").
174-
#html_file_suffix = None
175+
# html_file_suffix = None
175176

176177
# Output file base name for HTML help builder.
177-
htmlhelp_basename = 'Foliumdoc'
178+
htmlhelp_basename = "Foliumdoc"
178179

179180

180181
# -- Options for LaTeX output --------------------------------------------------
181182

182183
latex_elements = {
183-
# The paper size ('letterpaper' or 'a4paper').
184-
#'papersize': 'letterpaper',
185-
186-
# The font size ('10pt', '11pt' or '12pt').
187-
#'pointsize': '10pt',
188-
189-
# Additional stuff for the LaTeX preamble.
190-
#'preamble': '',
184+
# The paper size ('letterpaper' or 'a4paper').
185+
#'papersize': 'letterpaper',
186+
# The font size ('10pt', '11pt' or '12pt').
187+
#'pointsize': '10pt',
188+
# Additional stuff for the LaTeX preamble.
189+
#'preamble': '',
191190
}
192191

193192
# Grouping the document tree into LaTeX files. List of tuples
194193
# (source start file, target name, title, author, documentclass [howto/manual]).
195194
latex_documents = [
196-
('index', 'Folium.tex', 'Folium Documentation',
197-
'Rob Story', 'manual'),
195+
("index", "Folium.tex", "Folium Documentation", "Rob Story", "manual"),
198196
]
199197

200198
# The name of an image file (relative to this directory) to place at the top of
201199
# the title page.
202-
#latex_logo = None
200+
# latex_logo = None
203201

204202
# For "manual" documents, if this is true, then toplevel headings are parts,
205203
# not chapters.
206-
#latex_use_parts = False
204+
# latex_use_parts = False
207205

208206
# If true, show page references after internal links.
209-
#latex_show_pagerefs = False
207+
# latex_show_pagerefs = False
210208

211209
# If true, show URL addresses after external links.
212-
#latex_show_urls = False
210+
# latex_show_urls = False
213211

214212
# Documents to append as an appendix to all manuals.
215-
#latex_appendices = []
213+
# latex_appendices = []
216214

217215
# If false, no module index is generated.
218-
#latex_domain_indices = True
216+
# latex_domain_indices = True
219217

220218

221219
# -- Options for manual page output --------------------------------------------
222220

223221
# One entry per manual page. List of tuples
224222
# (source start file, name, description, authors, manual section).
225-
man_pages = [
226-
('index', 'folium', 'Folium Documentation',
227-
['Rob Story'], 1)
228-
]
223+
man_pages = [("index", "folium", "Folium Documentation", ["Rob Story"], 1)]
229224

230225
# If true, show URL addresses after external links.
231-
#man_show_urls = False
226+
# man_show_urls = False
232227

233228

234229
# -- Options for Texinfo output ------------------------------------------------
@@ -237,23 +232,29 @@
237232
# (source start file, target name, title, author,
238233
# dir menu entry, description, category)
239234
texinfo_documents = [
240-
('index', 'Folium', 'Folium Documentation',
241-
'Rob Story', 'Folium', 'One line description of project.',
242-
'Miscellaneous'),
235+
(
236+
"index",
237+
"Folium",
238+
"Folium Documentation",
239+
"Rob Story",
240+
"Folium",
241+
"One line description of project.",
242+
"Miscellaneous",
243+
),
243244
]
244245

245246
# Documents to append as an appendix to all manuals.
246-
#texinfo_appendices = []
247+
# texinfo_appendices = []
247248

248249
# If false, no module index is generated.
249-
#texinfo_domain_indices = True
250+
# texinfo_domain_indices = True
250251

251252
# How to display URL addresses: 'footnote', 'no', or 'inline'.
252-
#texinfo_show_urls = 'footnote'
253+
# texinfo_show_urls = 'footnote'
253254

254255
# Ignore tile URLs
255256
linkcheck_ignore = [
256-
r"https://free.*",
257+
r"https://free.*",
257258
]
258259

259260
intersphinx_mapping = {

examples/flask_example.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
app = Flask(__name__)
2222

2323

24-
@app.route('/')
24+
@app.route("/")
2525
def index():
2626
start_coords = (46.9540700, 142.7360300)
2727
folium_map = folium.Map(location=start_coords, zoom_start=14)
2828
return folium_map._repr_html_()
2929

3030

31-
if __name__ == '__main__':
31+
if __name__ == "__main__":
3232
app.run(debug=True)

0 commit comments

Comments
 (0)