Skip to content

Commit 0860091

Browse files
author
Joseph Hamman
committed
linters
1 parent 4455f7d commit 0860091

File tree

11 files changed

+267
-143
lines changed

11 files changed

+267
-143
lines changed

.pre-commit-config.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v3.1.0
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: end-of-file-fixer
7+
- id: check-docstring-first
8+
- id: check-json
9+
- id: check-yaml
10+
- id: double-quote-string-fixer
11+
12+
- repo: https://github.com/ambv/black
13+
rev: 19.10b0
14+
hooks:
15+
- id: black
16+
args: ["--line-length", "80", "--skip-string-normalization"]
17+
18+
- repo: https://gitlab.com/pycqa/flake8
19+
rev: 3.8.3
20+
hooks:
21+
- id: flake8
22+
- repo: https://github.com/asottile/seed-isort-config
23+
rev: v2.2.0
24+
hooks:
25+
- id: seed-isort-config
26+
- repo: https://github.com/pre-commit/mirrors-isort
27+
rev: v5.2.1
28+
hooks:
29+
- id: isort
30+
31+
- repo: https://github.com/prettier/prettier
32+
rev: 2.0.5
33+
hooks:
34+
- id: prettier

doc/conf.py

Lines changed: 88 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,33 @@
1212
# All configuration values have a default; values that are commented out
1313
# serve to show the default.
1414

15-
import sys
1615
import os
16+
import sys
17+
1718
import xbatcher
1819

1920
# If extensions (or modules to document with autodoc) are in another directory,
2021
# add these directories to sys.path here. If the directory is relative to the
2122
# documentation root, use os.path.abspath to make it absolute, like shown here.
22-
#sys.path.insert(0, os.path.abspath('.'))
23-
#sys.path.insert(os.path.abspath('..'))
23+
# sys.path.insert(0, os.path.abspath('.'))
24+
# sys.path.insert(os.path.abspath('..'))
2425

25-
print "python exec:", sys.executable
26-
print "sys.path:", sys.path
26+
print('python exec:', sys.executable)
27+
print('sys.path:', sys.path)
28+
print('xbatcher.version:', xbatcher.version)
2729

2830

2931
# -- General configuration ------------------------------------------------
3032

3133
# If your documentation needs a minimal Sphinx version, state it here.
32-
#needs_sphinx = '1.0'
34+
# needs_sphinx = '1.0'
3335

3436
# Add any Sphinx extension module names here, as strings. They can be
3537
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3638
# ones.
3739
extensions = [
38-
'sphinx.ext.mathjax', 'sphinx.ext.autodoc',
40+
'sphinx.ext.mathjax',
41+
'sphinx.ext.autodoc',
3942
'sphinx.ext.autosummary',
4043
'sphinx.ext.extlinks',
4144
'sphinx.ext.viewcode',
@@ -50,14 +53,17 @@
5053
# https://nbsphinx.readthedocs.io/en/0.2.14/never-execute.html
5154
nbsphinx_execute = 'never'
5255

56+
5357
# http://stackoverflow.com/questions/5599254/how-to-use-sphinxs-autodoc-to-document-a-classs-init-self-method
5458
def skip(app, what, name, obj, skip, options):
55-
if name == "__init__":
59+
if name == '__init__':
5660
return False
5761
return skip
5862

63+
5964
def setup(app):
60-
app.connect("autodoc-skip-member", skip)
65+
app.connect('autodoc-skip-member', skip)
66+
6167

6268
# link to github issues
6369
extlinks = {'issue': ('https://github.com/xbatcher/xbatcher/issues/%s', 'GH')}
@@ -73,7 +79,7 @@ def setup(app):
7379
source_suffix = '.rst'
7480

7581
# The encoding of source files.
76-
#source_encoding = 'utf-8-sig'
82+
# source_encoding = 'utf-8-sig'
7783

7884
# The master toctree document.
7985
master_doc = 'index'
@@ -93,41 +99,41 @@ def setup(app):
9399

94100
# The language for content autogenerated by Sphinx. Refer to documentation
95101
# for a list of supported languages.
96-
#language = None
102+
# language = None
97103

98104
# There are two options for replacing |today|: either, you set today to some
99105
# non-false value, then it is used:
100-
#today = ''
106+
# today = ''
101107
# Else, today_fmt is used as the format for a strftime call.
102-
#today_fmt = '%B %d, %Y'
108+
# today_fmt = '%B %d, %Y'
103109

104110
# List of patterns, relative to source directory, that match files and
105111
# directories to ignore when looking for source files.
106112
exclude_patterns = ['_build']
107113

108114
# The reST default role (used for this markup: `text`) to use for all
109115
# documents.
110-
#default_role = None
116+
# default_role = None
111117

112118
# If true, '()' will be appended to :func: etc. cross-reference text.
113-
#add_function_parentheses = True
119+
# add_function_parentheses = True
114120

115121
# If true, the current module name will be prepended to all description
116122
# unit titles (such as .. function::).
117-
#add_module_names = True
123+
# add_module_names = True
118124

119125
# If true, sectionauthor and moduleauthor directives will be shown in the
120126
# output. They are ignored by default.
121-
#show_authors = False
127+
# show_authors = False
122128

123129
# The name of the Pygments (syntax highlighting) style to use.
124130
pygments_style = 'sphinx'
125131

126132
# A list of ignored prefixes for module index sorting.
127-
#modindex_common_prefix = []
133+
# modindex_common_prefix = []
128134

129135
# If true, keep warnings as "system message" paragraphs in the built documents.
130-
#keep_warnings = False
136+
# keep_warnings = False
131137

132138

133139
# -- Options for HTML output ----------------------------------------------
@@ -136,37 +142,38 @@ def setup(app):
136142

137143
if not on_rtd: # only import and set the theme if we're building docs locally
138144
import sphinx_rtd_theme
145+
139146
html_theme = 'sphinx_rtd_theme'
140147
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
141148

142149
# The theme to use for HTML and HTML Help pages. See the documentation for
143150
# a list of builtin themes.
144-
#tml_theme = 'default'
145-
html_theme = "sphinx_rtd_theme"
151+
# tml_theme = 'default'
152+
html_theme = 'sphinx_rtd_theme'
146153

147154
# Theme options are theme-specific and customize the look and feel of a theme
148155
# further. For a list of options available for each theme, see the
149156
# documentation.
150-
#html_theme_options = {}
157+
# html_theme_options = {}
151158

152159
# Add any paths that contain custom themes here, relative to this directory.
153-
#html_theme_path = []
160+
# html_theme_path = []
154161

155162
# The name for this set of Sphinx documents. If None, it defaults to
156163
# "<project> v<release> documentation".
157-
#html_title = None
164+
# html_title = None
158165

159166
# A shorter title for the navigation bar. Default is the same as html_title.
160-
#html_short_title = None
167+
# html_short_title = None
161168

162169
# The name of an image file (relative to this directory) to place at the top
163170
# of the sidebar.
164-
#html_logo = None
171+
# html_logo = None
165172

166173
# The name of an image file (within the static path) to use as favicon of the
167174
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
168175
# pixels large.
169-
#html_favicon = None
176+
# html_favicon = None
170177

171178
# Add any paths that contain custom static files (such as style sheets) here,
172179
# relative to this directory. They are copied after the builtin static files,
@@ -176,48 +183,48 @@ def setup(app):
176183
# Add any extra paths that contain custom files (such as robots.txt or
177184
# .htaccess) here, relative to this directory. These files are copied
178185
# directly to the root of the documentation.
179-
#html_extra_path = []
186+
# html_extra_path = []
180187

181188
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
182189
# using the given strftime format.
183-
#html_last_updated_fmt = '%b %d, %Y'
190+
# html_last_updated_fmt = '%b %d, %Y'
184191

185192
# If true, SmartyPants will be used to convert quotes and dashes to
186193
# typographically correct entities.
187-
#html_use_smartypants = True
194+
# html_use_smartypants = True
188195

189196
# Custom sidebar templates, maps document names to template names.
190-
#html_sidebars = {}
197+
# html_sidebars = {}
191198

192199
# Additional templates that should be rendered to pages, maps page names to
193200
# template names.
194-
#html_additional_pages = {}
201+
# html_additional_pages = {}
195202

196203
# If false, no module index is generated.
197-
#html_domain_indices = True
204+
# html_domain_indices = True
198205

199206
# If false, no index is generated.
200-
#html_use_index = True
207+
# html_use_index = True
201208

202209
# If true, the index is split into individual pages for each letter.
203-
#html_split_index = False
210+
# html_split_index = False
204211

205212
# If true, links to the reST sources are added to the pages.
206-
#html_show_sourcelink = True
213+
# html_show_sourcelink = True
207214

208215
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
209-
#html_show_sphinx = True
216+
# html_show_sphinx = True
210217

211218
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
212-
#html_show_copyright = True
219+
# html_show_copyright = True
213220

214221
# If true, an OpenSearch description file will be output, and all pages will
215222
# contain a <link> tag referring to it. The value of this option must be the
216223
# base URL from which the finished HTML is served.
217-
#html_use_opensearch = ''
224+
# html_use_opensearch = ''
218225

219226
# This is the file name suffix for HTML files (e.g. ".xhtml").
220-
#html_file_suffix = None
227+
# html_file_suffix = None
221228

222229
# Output file base name for HTML help builder.
223230
htmlhelp_basename = 'xbatcherdoc'
@@ -226,56 +233,64 @@ def setup(app):
226233
# -- Options for LaTeX output ---------------------------------------------
227234

228235
latex_elements = {
229-
# The paper size ('letterpaper' or 'a4paper').
230-
#'papersize': 'letterpaper',
231-
232-
# The font size ('10pt', '11pt' or '12pt').
233-
#'pointsize': '10pt',
234-
235-
# Additional stuff for the LaTeX preamble.
236-
#'preamble': '',
236+
# The paper size ('letterpaper' or 'a4paper').
237+
# 'papersize': 'letterpaper',
238+
# The font size ('10pt', '11pt' or '12pt').
239+
# 'pointsize': '10pt',
240+
# Additional stuff for the LaTeX preamble.
241+
# 'preamble': '',
237242
}
238243

239244
# Grouping the document tree into LaTeX files. List of tuples
240245
# (source start file, target name, title,
241246
# author, documentclass [howto, manual, or own class]).
242247
latex_documents = [
243-
('index', 'xbatcher.tex', u'xbatcher Documentation',
244-
u'xbatcher developers', 'manual'),
248+
(
249+
'index',
250+
'xbatcher.tex',
251+
u'xbatcher Documentation',
252+
u'xbatcher developers',
253+
'manual',
254+
),
245255
]
246256

247257
# The name of an image file (relative to this directory) to place at the top of
248258
# the title page.
249-
#latex_logo = None
259+
# latex_logo = None
250260

251261
# For "manual" documents, if this is true, then toplevel headings are parts,
252262
# not chapters.
253-
#latex_use_parts = False
263+
# latex_use_parts = False
254264

255265
# If true, show page references after internal links.
256-
#latex_show_pagerefs = False
266+
# latex_show_pagerefs = False
257267

258268
# If true, show URL addresses after external links.
259-
#latex_show_urls = False
269+
# latex_show_urls = False
260270

261271
# Documents to append as an appendix to all manuals.
262-
#latex_appendices = []
272+
# latex_appendices = []
263273

264274
# If false, no module index is generated.
265-
#latex_domain_indices = True
275+
# latex_domain_indices = True
266276

267277

268278
# -- Options for manual page output ---------------------------------------
269279

270280
# One entry per manual page. List of tuples
271281
# (source start file, name, description, authors, manual section).
272282
man_pages = [
273-
('index', 'xbatcher', u'xbatcher Documentation',
274-
[u'xbatcher developers'], 1)
283+
(
284+
'index',
285+
'xbatcher',
286+
u'xbatcher Documentation',
287+
[u'xbatcher developers'],
288+
1,
289+
)
275290
]
276291

277292
# If true, show URL addresses after external links.
278-
#man_show_urls = False
293+
# man_show_urls = False
279294

280295

281296
# -- Options for Texinfo output -------------------------------------------
@@ -284,26 +299,32 @@ def setup(app):
284299
# (source start file, target name, title, author,
285300
# dir menu entry, description, category)
286301
texinfo_documents = [
287-
('index', 'xbatcher', u'xbatcher Documentation',
288-
u'xbatcher developers', 'xbatcher', 'One line description of project.',
289-
'Miscellaneous'),
302+
(
303+
'index',
304+
'xbatcher',
305+
u'xbatcher Documentation',
306+
u'xbatcher developers',
307+
'xbatcher',
308+
'One line description of project.',
309+
'Miscellaneous',
310+
),
290311
]
291312

292313
# Documents to append as an appendix to all manuals.
293-
#texinfo_appendices = []
314+
# texinfo_appendices = []
294315

295316
# If false, no module index is generated.
296-
#texinfo_domain_indices = True
317+
# texinfo_domain_indices = True
297318

298319
# How to display URL addresses: 'footnote', 'no', or 'inline'.
299-
#texinfo_show_urls = 'footnote'
320+
# texinfo_show_urls = 'footnote'
300321

301322
# If true, do not generate a @detailmenu in the "Top" node's menu.
302-
#texinfo_no_detailmenu = False
323+
# texinfo_no_detailmenu = False
303324

304325

305326
# Example configuration for intersphinx: refer to the Python standard library.
306327
intersphinx_mapping = {
307328
'python': ('https://docs.python.org/3/', None),
308-
'xarray': ('http://xarray.pydata.org/en/stable/', None)
329+
'xarray': ('http://xarray.pydata.org/en/stable/', None),
309330
}

doc/environment.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ dependencies:
1010
- ipython
1111
- matplotlib
1212
- pip:
13-
- docrep
14-
- nbsphinx
13+
- docrep
14+
- nbsphinx

0 commit comments

Comments
 (0)