Skip to content

Commit 420c013

Browse files
committed
style: parens should indent the same as their opening line
1 parent 53f00a0 commit 420c013

Some content is hidden

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

43 files changed

+164
-166
lines changed

ci/comment_on_fixes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
comment = (
1414
f"This is now released as part of [coverage {version}]" +
1515
f"(https://pypi.org/project/coverage/{version})."
16-
)
16+
)
1717
print(f"Comment will be: {comment}")
1818

1919
owner = "nedbat"

coverage/cmdline.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,7 @@ class CoverageOptionParser(optparse.OptionParser):
232232
"""
233233

234234
def __init__(self, *args, **kwargs):
235-
super().__init__(
236-
add_help_option=False, *args, **kwargs
237-
)
235+
super().__init__(add_help_option=False, *args, **kwargs)
238236
self.set_defaults(
239237
# Keep these arguments alphabetized by their names.
240238
action=None,
@@ -267,7 +265,7 @@ def __init__(self, *args, **kwargs):
267265
timid=None,
268266
title=None,
269267
version=None,
270-
)
268+
)
271269

272270
self.disable_interspersed_args()
273271

@@ -352,7 +350,7 @@ def get_prog_name(self):
352350
Opts.debug,
353351
Opts.help,
354352
Opts.rcfile,
355-
]
353+
]
356354

357355
COMMANDS = {
358356
'annotate': CmdOptionParser(
@@ -473,7 +471,7 @@ def get_prog_name(self):
473471
Opts.output_lcov,
474472
Opts.omit,
475473
Opts.quiet,
476-
] + GLOBAL_ARGS,
474+
] + GLOBAL_ARGS,
477475
usage="[options] [modules]",
478476
description="Generate an LCOV report of coverage results.",
479477
),
@@ -648,7 +646,7 @@ def command_line(self, argv):
648646
check_preimported=True,
649647
context=options.context,
650648
messages=not options.quiet,
651-
)
649+
)
652650

653651
if options.action == "debug":
654652
return self.do_debug(args)
@@ -675,7 +673,7 @@ def command_line(self, argv):
675673
omit=omit,
676674
include=include,
677675
contexts=contexts,
678-
)
676+
)
679677

680678
# We need to be able to import from the current directory, because
681679
# plugins may try to, for example, to read Django settings.
@@ -692,7 +690,7 @@ def command_line(self, argv):
692690
skip_empty=options.skip_empty,
693691
sort=options.sort,
694692
**report_args
695-
)
693+
)
696694
elif options.action == "annotate":
697695
self.coverage.annotate(directory=options.directory, **report_args)
698696
elif options.action == "html":
@@ -704,25 +702,25 @@ def command_line(self, argv):
704702
show_contexts=options.show_contexts,
705703
title=options.title,
706704
**report_args
707-
)
705+
)
708706
elif options.action == "xml":
709707
total = self.coverage.xml_report(
710708
outfile=options.outfile,
711709
skip_empty=options.skip_empty,
712710
**report_args
713-
)
711+
)
714712
elif options.action == "json":
715713
total = self.coverage.json_report(
716714
outfile=options.outfile,
717715
pretty_print=options.pretty_print,
718716
show_contexts=options.show_contexts,
719717
**report_args
720-
)
718+
)
721719
elif options.action == "lcov":
722720
total = self.coverage.lcov_report(
723721
outfile=options.outfile,
724722
**report_args
725-
)
723+
)
726724
else:
727725
# There are no other possible actions.
728726
raise AssertionError

coverage/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ def debug_info(self):
499499
"""Make a list of (name, value) pairs for writing debug info."""
500500
return human_sorted_items(
501501
(k, v) for k, v in self.__dict__.items() if not k.startswith("_")
502-
)
502+
)
503503

504504

505505
def config_files_to_try(config_file):

coverage/control.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ def __init__(
250250
source=source, source_pkgs=source_pkgs, run_omit=omit, run_include=include, debug=debug,
251251
report_omit=omit, report_include=include,
252252
concurrency=concurrency, context=context,
253-
)
253+
)
254254

255255
# If we have sub-process measurement happening automatically, then we
256256
# want any explicit creation of a Coverage object to mean, this process
@@ -489,7 +489,7 @@ def _init_for_start(self):
489489
branch=self.config.branch,
490490
warn=self._warn,
491491
concurrency=concurrency,
492-
)
492+
)
493493

494494
suffix = self._data_suffix_specified
495495
if suffix:
@@ -515,10 +515,10 @@ def _init_for_start(self):
515515
", ".join(
516516
plugin._coverage_plugin_name
517517
for plugin in self._plugins.file_tracers
518-
),
518+
),
519519
self._collector.tracer_name(),
520-
)
521520
)
521+
)
522522
for plugin in self._plugins.file_tracers:
523523
plugin._coverage_enabled = False
524524

@@ -835,7 +835,7 @@ def analysis2(self, morf):
835835
sorted(analysis.excluded),
836836
sorted(analysis.missing),
837837
analysis.missing_formatted(),
838-
)
838+
)
839839

840840
def _analyze(self, it):
841841
"""Analyze a single morf or code unit.
@@ -1146,7 +1146,7 @@ def plugin_info(plugins):
11461146
)
11471147
)),
11481148
('command_line', " ".join(getattr(sys, 'argv', ['-none-']))),
1149-
]
1149+
]
11501150

11511151
if self._inorout:
11521152
info.extend(self._inorout.sys_info())

coverage/debug.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ def __repr__(self):
211211
klass=self.__class__.__name__,
212212
id=id(self),
213213
attrs=" ".join(f"{k}={v!r}" for k, v in show_attrs),
214-
)
214+
)
215215

216216

217217
def simplify(v): # pragma: debugging

coverage/html.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def __init__(self, cov):
188188
'mis': 'mis show_mis',
189189
'par': 'par run show_par',
190190
'run': 'run',
191-
}
191+
},
192192
}
193193
self.pyfile_html_source = read_data("pyfile.html")
194194
self.source_tmpl = Templite(self.pyfile_html_source, self.template_globals)
@@ -292,7 +292,7 @@ def html_file(self, fr, analysis):
292292
ldata.annotate = ",   ".join(
293293
f"{ldata.number} ↛ {d}"
294294
for d in ldata.short_annotations
295-
)
295+
)
296296
else:
297297
ldata.annotate = None
298298

@@ -306,7 +306,7 @@ def html_file(self, fr, analysis):
306306
", ".join(
307307
f"{num:d}) {ann_long}"
308308
for num, ann_long in enumerate(longs, start=1)
309-
),
309+
),
310310
)
311311
else:
312312
ldata.annotate_long = None

coverage/inorout.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ def sys_info(self):
591591
'source_match', 'source_pkgs_match',
592592
'include_match', 'omit_match',
593593
'cover_match', 'pylib_match', 'third_match',
594-
]
594+
]
595595

596596
for matcher_name in matcher_names:
597597
matcher = getattr(self, matcher_name)

coverage/jsonreport.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def report(self, morfs, outfile=None):
7070
json.dump(
7171
self.report_data,
7272
outfile,
73-
indent=4 if self.config.json_pretty_print else None
73+
indent=(4 if self.config.json_pretty_print else None),
7474
)
7575

7676
return self.total.n_statements and self.total.pc_covered

coverage/misc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ def _needs_to_implement(that, func_name):
272272

273273
raise NotImplementedError(
274274
f"{thing} {name!r} needs to implement {func_name}()"
275-
)
275+
)
276276

277277

278278
class DefaultValue:

coverage/parser.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,15 +1231,15 @@ def _handle__With(self, node):
12311231
if with_block.break_from:
12321232
self.process_break_exits(
12331233
self._combine_finally_starts(with_block.break_from, with_exit)
1234-
)
1234+
)
12351235
if with_block.continue_from:
12361236
self.process_continue_exits(
12371237
self._combine_finally_starts(with_block.continue_from, with_exit)
1238-
)
1238+
)
12391239
if with_block.return_from:
12401240
self.process_return_exits(
12411241
self._combine_finally_starts(with_block.return_from, with_exit)
1242-
)
1242+
)
12431243
return exits
12441244

12451245
_handle__AsyncWith = _handle__With

0 commit comments

Comments
 (0)