misc,python: Run pre-commit run --all-files
Applies the `pyupgrade` hook to all files in the repo. Change-Id: I9879c634a65c5fcaa9567c63bc5977ff97d5d3bf
This commit is contained in:
@@ -63,7 +63,7 @@ class ResourceJsonCreator:
|
||||
|
||||
def __init__(self):
|
||||
self.schema = {}
|
||||
with open("schema/schema.json", "r") as f:
|
||||
with open("schema/schema.json") as f:
|
||||
self.schema = json.load(f)
|
||||
|
||||
def _get_file_data(self, url):
|
||||
@@ -104,9 +104,7 @@ class ResourceJsonCreator:
|
||||
for filename in os.listdir(folder_path):
|
||||
file_path = os.path.join(folder_path, filename)
|
||||
if os.path.isfile(file_path):
|
||||
with open(
|
||||
file_path, "r", encoding="utf-8", errors="ignore"
|
||||
) as f:
|
||||
with open(file_path, encoding="utf-8", errors="ignore") as f:
|
||||
contents = f.read()
|
||||
if id in contents:
|
||||
file_path = file_path.replace("\\", "/")
|
||||
|
||||
@@ -35,14 +35,14 @@ from api.json_client import JSONClient
|
||||
|
||||
|
||||
def get_json():
|
||||
with open("test/refs/test_json.json", "r") as f:
|
||||
with open("test/refs/test_json.json") as f:
|
||||
jsonFile = f.read()
|
||||
return json.loads(jsonFile)
|
||||
|
||||
|
||||
def mockinit(self, file_path):
|
||||
self.file_path = Path("test/refs/") / file_path
|
||||
with open(self.file_path, "r") as f:
|
||||
with open(self.file_path) as f:
|
||||
self.resources = json.load(f)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user