Lintcheck: Fix Errors, because of course

This commit is contained in:
xFrednet 2024-07-22 18:14:48 +02:00
parent 10bf729e3f
commit 23b231a5d6
No known key found for this signature in database
GPG key ID: F5C59D0E669E5302
2 changed files with 5 additions and 1 deletions

View file

@ -119,10 +119,10 @@ jobs:
# https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-markdown-summary # https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-markdown-summary
# That's why we first log to file and then to the summary and logs # That's why we first log to file and then to the summary and logs
run: | run: |
./target/debug/lintcheck diff {base,head}/ci_crates_logs.json >> full_diff.md
./target/debug/lintcheck diff {base,head}/ci_crates_logs.json --truncate >> truncated_diff.md ./target/debug/lintcheck diff {base,head}/ci_crates_logs.json --truncate >> truncated_diff.md
head -c 1024000 truncated_diff.md >> $GITHUB_STEP_SUMMARY head -c 1024000 truncated_diff.md >> $GITHUB_STEP_SUMMARY
cat truncated_diff.md cat truncated_diff.md
./target/debug/lintcheck diff {base,head}/ci_crates_logs.json >> full_diff.md
- name: Upload full diff - name: Upload full diff
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4

View file

@ -82,6 +82,10 @@ pub(crate) fn diff(old_path: &Path, new_path: &Path, truncate: bool) {
print_summary_table(&lint_warnings); print_summary_table(&lint_warnings);
println!(); println!();
if lint_warnings.is_empty() {
return;
}
let truncate_after = if truncate { let truncate_after = if truncate {
// Max 15 ensures that we at least have five messages per lint // Max 15 ensures that we at least have five messages per lint
DEFAULT_LIMIT_PER_LINT DEFAULT_LIMIT_PER_LINT