mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-20 21:27:50 -06:00
Implement GitComment class and update workflow files
A new GitComment class was implemented to replace Diagnostic for deleted file checks. As part of this change, both main workflow files (printer-linter-pr-diagnose.yml and printer-linter-pr-post.yml) have been updated to accommodate this new class. Also, reports now use 'comment.md' instead of 'fixes.yml'. All of this is ultimately geared at improving diagnostic functionality and allowing deleted file checks to output directly to a Git comment. CURA-10903
This commit is contained in:
parent
702f8573c3
commit
561a40d000
5 changed files with 28 additions and 16 deletions
|
@ -42,18 +42,19 @@ def main() -> None:
|
|||
settings = yaml.load(f, yaml.FullLoader)
|
||||
|
||||
full_body_check = {"Diagnostics": []}
|
||||
comments_check = {"Git Comment": []}
|
||||
|
||||
for file in files:
|
||||
if not path.exists(file):
|
||||
print(f"Can't find the file: {file}")
|
||||
return
|
||||
|
||||
if args.deleted and files ==[]:
|
||||
if args.deleted:
|
||||
for file in args.Files:
|
||||
deletedFiles = diagnoseIssuesWithFile(file, settings )
|
||||
full_body_check["Diagnostics"].extend([d.toDict() for d in deletedFiles])
|
||||
comments_check["GitComment"].extend([d.toDict() for d in deletedFiles])
|
||||
|
||||
results = yaml.dump(full_body_check, default_flow_style=False, indent=4, width=240)
|
||||
results = yaml.dump(comments_check, default_flow_style=False, indent=4, width=240)
|
||||
|
||||
if report:
|
||||
report.write_text(results)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue