tmbdev / tarproc

File opened without the with statement PTC-W0010
Anti-pattern
Critical
4 years ago4 years old
Use the with statement to open a file
231    assert os.path.isdir("./docs")
232    for fname in required_files:
233        assert os.path.exists(fname), fname
234    assert "run: make" not in open(".github/workflows/test.yml").read()235
Use the with statement to open a file
 63def release(c):
 64    "Tag the current version as a release on Github."
 65    assert "working tree clean" in c.run("git status").stdout
 66    version = open("VERSION").read().strip() 67    os.system(f"hub release create {version}")  # interactive
 68
 69
Use the with statement to open a file
 38def newversion(c):
 39    "Increment the version number."
 40    assert "working tree clean" in c.run("git status").stdout
 41    text = open("setup.py").read() 42    version = re.search('version *= *"([0-9.]+)"', text).group(1)
 43    print("old version", version)
 44    text = re.sub(