Skip to content

Added issue count generation#5

Open
tqtsar wants to merge 1 commit into
spearbit-audits:developfrom
tqtsar:develop
Open

Added issue count generation#5
tqtsar wants to merge 1 commit into
spearbit-audits:developfrom
tqtsar:develop

Conversation

@tqtsar

@tqtsar tqtsar commented Mar 6, 2022

Copy link
Copy Markdown

No description provided.

@hrkrshnn hrkrshnn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Left a suggestion.

Comment thread compile.py
for content in issue_dict[label]:
report.write(content.replace("\r\n", "\n"))

with open("severity_counts.sh", "w") as counts_file:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you miss committing this file here?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume you have a bash script to replace summary.tex. An alternate approach is the following, split the file summary.tex into summary.tex and summary_table.tex.

Where summary.tex would include summary_table.tex. This script can directly generate summary_table.tex.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw no need to commit the file because the script creates it from scratch. I tried to keep the repo as clean as possible.

I added a few lines in report-template's generate.sh file to load the vars set in severity_counts.sh and then replace some placeholders in the file. It doesn't replace the whole file. I'll take a look at this new summary_table.tex approach later.

All this should be temporary. I was trying to think about a more automated solution that doesn't require copying/moving files between folders.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

automated solution that doesn't require copying/moving files between folders.

Good idea. This is probably better. To give context, this script (compile-issues) came later. Initially, we were just writing everything in hackmd. Now, we just moved everything to GitHub.

Comment thread compile.py
total_count = 0
for label in SEVERITY_LABELS:
variable_name = label[10:].upper().replace(" ", "_") + "_COUNT="
count = len(issue_dict[label])

@hrkrshnn hrkrshnn Mar 7, 2022

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If label does not exist in issue_dict, this would throw, right? Can you add a check for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants