Conversation
MarioVilas
approved these changes
Jul 24, 2026
MarioVilas
added a commit
to MarioVilas/shcheck
that referenced
this pull request
Jul 24, 2026
When no value for the ``default`` parameter is set, ``None`` is used, which is the right choice instead of the misleading ``False``.
Information disclosure lines never reached the file because output_file was passed to str.format() instead of log(), due to badly placed parenthesis. The log() statements in parse_csp() were never adjusted, so CSP output was never part of the output file. Fix both bugs by adding the file handle to the global options variable, instead of passing it as an extra parameter to each log() call. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Open the output file in parse_options() and keep the handle in options.output_file, so everything log() prints, banner included, lands in the file. With -j the file still holds only the JSON document. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Parse the file on its own instead of comparing it with stdout, so the file stays valid JSON regardless of future changes to the stdout format. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Author
|
I revisited this PR because I found a bug: neither the information disclosure lines nor the CSP where added to the output file. The bugs are fixed and I refactored the writing logic. My previous approach of adding the output file as a parameter to each and every The logic is now covered by tests. All tests pass All commits that used AI where marked with the AI as co-author. Unmarked commits did not use AI. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add the
-oand--outputflags which can be used to specify a file where the program output is written to. The output is still logged to console even when an output file is specified.If the
--jsonflag is set the output will be in JSON format.