-
-
Notifications
You must be signed in to change notification settings - Fork 8
Closed
Description
Its weird that this worked!
Since we're omitting the entire file, we can probably remove
Lines 96 to 97 in f01a6b1
| # ignore any branch that makes the module executable | |
| 'if __name__ == "__main__"', |
cpp_linter/__init__.py.
I don't see this used anywhere else in the source. On the other hand, it might be handy to use for quick tests in developing new features.
For example
# in new_module.py
def new_feature(arg: int) -> bool | None:
if arg:
return arg > 0
return None
if __name__ == "__main__":
assert new_feature(-1) is False
assert new_feature(1) is True
assert new_feature(0) is NoneAnd then just run python -m cpp_linter.new_module.
Originally posted by @2bndy5 in #140 (comment)
Metadata
Metadata
Assignees
Labels
No labels