File tree Expand file tree Collapse file tree 5 files changed +7
-11
lines changed Expand file tree Collapse file tree 5 files changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -332,7 +332,8 @@ exclude_also = [
332
332
' class .*\bProtocol\b.*\):' ,
333
333
" raise NotImplementedError" ,
334
334
' .*if "sphinx" in sys.modules:' ,
335
- ' TODO: test this line'
335
+ ' TODO: test this line' ,
336
+ ' if __name__ == "__main__":' ,
336
337
]
337
338
partial_branches = [
338
339
" pragma: no branch" ,
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ def test_yield_pre_commit_version_data() -> None:
27
27
rev: v0.11.0
28
28
- repo: https://github.com/psf/black-pre-commit-mirror
29
29
rev: 25.1.0
30
+ - bad: data
30
31
"""
31
32
results = tuple (yield_pre_commit_version_data (text ))
32
33
assert results == (
Original file line number Diff line number Diff line change @@ -399,5 +399,5 @@ def main() -> None: # pragma: no cover
399
399
"""
400
400
401
401
402
- if __name__ == "__main__" : # pragma: no cover
402
+ if __name__ == "__main__" :
403
403
main ()
Original file line number Diff line number Diff line change @@ -122,5 +122,5 @@ def main(argv: list[str]) -> None:
122
122
pickle .dump (results , f )
123
123
124
124
125
- if __name__ == "__main__" : # pragma: no cover
125
+ if __name__ == "__main__" :
126
126
main (sys .argv [1 :])
Original file line number Diff line number Diff line change @@ -78,9 +78,7 @@ def update_requirements(
78
78
return changed
79
79
80
80
81
- def main () -> int :
82
- """Run program."""
83
-
81
+ if __name__ == "__main__" :
84
82
source_root = Path .cwd ().absolute ()
85
83
86
84
# Double-check we found the right directory
@@ -97,8 +95,4 @@ def main() -> int:
97
95
for name , version in yield_pre_commit_version_data (pre_commit_text )
98
96
}
99
97
changed = update_requirements (test_requirements , pre_commit_versions )
100
- return int (changed )
101
-
102
-
103
- if __name__ == "__main__" :
104
- sys .exit (main ())
98
+ sys .exit (int (changed ))
You can’t perform that action at this time.
0 commit comments