Its weird that this worked!
Since we're omitting the entire file, we can probably remove
|
# ignore any branch that makes the module executable |
|
'if __name__ == "__main__"', |
because that only affected
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 None
And then just run python -m cpp_linter.new_module.
Originally posted by @2bndy5 in #140 (comment)
Its weird that this worked!
Since we're omitting the entire file, we can probably remove
cpp-linter/pyproject.toml
Lines 96 to 97 in f01a6b1
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
And then just run
python -m cpp_linter.new_module.Originally posted by @2bndy5 in #140 (comment)