Erotemic / mkinit

Compare dd609e2 ... +0 ... bfd8fd9

No flags found

Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.

e.g., #unittest #integration

#production #enterprise

#frontend #backend

Learn more about Codecov Flags here.

Showing 2 of 4 files from the diff.

@@ -3,7 +3,7 @@
Loading
3 3
Regenerate Input Command
4 4
mkinit ~/code/mkinit/mkinit
5 5
"""
6 -
__version__ = "0.3.2"
6 +
__version__ = "0.3.3"
7 7
8 8
__submodules__ = [
9 9
    "dynamic_mkinit",

@@ -163,9 +163,11 @@
Loading
163 163
    private = user_decl.get("__private__", [])
164 164
    protected = user_decl.get("__protected__", [])
165 165
    external = user_decl.get("__external__", [])
166 +
    ignore = user_decl.get("__ignore__", [])
166 167
167 168
    modname, imports, from_imports = _static_parse_imports(
168 -
        modpath, submodules=submodules, respect_all=respect_all, external=external
169 +
        modpath, submodules=submodules, respect_all=respect_all,
170 +
        external=external, ignore=ignore
169 171
    )
170 172
171 173
    logger.debug("Found {} imports".format(len(imports)))
@@ -251,6 +253,12 @@
Loading
251 253
            user_decl["__private__"] = static.parse_static_value("__private__", source)
252 254
        except NameError:
253 255
            pass
256 +
257 +
        try:
258 +
            # Ignore these modules and attributes
259 +
            user_decl["__ignore__"] = static.parse_static_value("__ignore__", source)
260 +
        except NameError:
261 +
            pass
254 262
    return user_decl
255 263
256 264
@@ -340,7 +348,7 @@
Loading
340 348
    return valid_attrs
341 349
342 350
343 -
def _static_parse_imports(modpath, submodules=None, external=None, respect_all=True):
351 +
def _static_parse_imports(modpath, submodules=None, external=None, respect_all=True, ignore=None):
344 352
    """
345 353
    Args:
346 354
        modpath (PathLike): base path to a package (with an __init__)
@@ -423,10 +431,16 @@
Loading
423 431
                    "Failed to parse module {!r}, ex = {!r}".format(rel_modname, ex)
424 432
                )
425 433
            else:
434 +
                if ignore:
435 +
                    ignore = set(ignore)
436 +
                    valid_attrs = [v for v in valid_attrs if v not in ignore]
426 437
                from_imports.append(("." + rel_modname, sorted(valid_attrs)))
427 438
        else:
428 439
            valid_attrs = attr_list
429 -
            from_imports.append(("." + rel_modname, attr_list))
440 +
            if ignore:
441 +
                ignore = set(ignore)
442 +
                valid_attrs = [v for v in valid_attrs if v not in ignore]
443 +
            from_imports.append(("." + rel_modname, valid_attrs))
430 444
431 445
    if external:
432 446
        for ext_modname in external:

Everything is accounted for!

No changes detected that need to be reviewed.
What changes does Codecov check for?
Lines, not adjusted in diff, that have changed coverage data.
Files that introduced coverage data that had none before.
Files that have missing coverage data that once were tracked.
Files Coverage
mkinit -0.50% 83.10%
Project Totals (8 files) 83.10%
Loading