Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/tool/dartanalyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def config(self, params):
os.remove(config_file)
copyfile(os.path.join(envs.get("DART_HOME"), "analysis_options.yaml"), config_file)
f = open(config_file)
config = yaml.load(f, Loader=yaml.FullLoader)
config = yaml.safe_load(f)
f.close()

# 设置过滤
Expand Down
4 changes: 2 additions & 2 deletions client/tool/detekt.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def config(self, params, detekt_home):
if enabled_rules:
copyfile(os.path.join(detekt_home, "detekt-config-example.yml"), config_file)
config = open(config_file)
content = yaml.load(config, Loader=yaml.FullLoader)
content = yaml.safe_load(config)
for item in content.values():
if not isinstance(item, dict):
continue
Expand All @@ -115,7 +115,7 @@ def config(self, params, detekt_home):
else:
# 若是配置字符串
user_config = json.loads(user_plugins_config)
content = yaml.load(open(config_file))
content = yaml.safe_load(open(config_file))
content.update(user_config)
config = open(config_file, "w")
# content中可能部分为unicode编码,dump时候可能会报错,这里是
Expand Down
2 changes: 1 addition & 1 deletion client/tool/golangcilint.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def config(self, params):
os.remove(config_file)
copyfile(os.path.join(config_home, ".golangci.example.yml"), config_file)
f = open(config_file)
config = yaml.load(f, Loader=yaml.FullLoader)
config = yaml.safe_load(f)
f.close()

config["linters"]["enable"] = [rule for rule in rules]
Expand Down
2 changes: 1 addition & 1 deletion client/util/yamlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def read_section(self, filepath, section):
# print("\n[ 全量加载 ] :")
# start_time = time.time()
# with open(file_path, 'r', encoding='utf-8') as fp:
# data = yaml.load(fp)
# data = yaml.safe_load(fp)
# use_time = time.time() - start_time
# print("-" * 50)
# print(json.dumps(data[section_name], indent=2))
Expand Down