Skip to content

autoring: add -q option #1944

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

eliasdaler
Copy link
Contributor

Currently authoring prints a lot of stuff during ISO build process which adds a lot of noise between build runs.
This adds option to only print errors when "-q" is specified and print nothing when ISO build succeeds.

Copy link
Contributor

coderabbitai bot commented Jun 26, 2025

Walkthrough

A quiet mode feature was introduced to the command-line tool by adding a -q option. When this flag is set, informational output is suppressed, and only essential error or critical messages are printed. The implementation involves wrapping existing print statements with a conditional check on the quiet flag.

Changes

File(s) Change Summary
tools/authoring/authoring.cc Added -q (quiet mode) command-line option; wrapped status/info print statements with quiet flag checks; no changes to exported/public APIs.

Poem

Quietly now, the tool does run,
Hopping along, its work gets done.
No chatter, no fuss, just silent delight—
Processing files out of sight.
With a twitch of the nose and a dash of code,
The rabbit’s made quiet the new default mode!
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
tools/authoring/authoring.cc (1)

93-510: Consider refactoring the main function to reduce complexity.

The static analysis correctly identifies that the main function has high cyclomatic complexity (now 59, threshold 9). While the quiet mode additions are justified, consider extracting logical sections into separate functions to improve maintainability.

Potential refactoring opportunities:

  • Extract JSON parsing and validation logic
  • Extract file processing and compression logic
  • Extract ISO structure creation logic

This would make the code more modular and easier to test while reducing the complexity of the main function.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8f8cc3d and 0fbc420.

📒 Files selected for processing (1)
  • tools/authoring/authoring.cc (6 hunks)
🧰 Additional context used
🪛 GitHub Check: CodeScene Cloud Delta Analysis (main)
tools/authoring/authoring.cc

[warning] 99-383: ❌ Getting worse: Complex Method
main increases in cyclomatic complexity from 55 to 59, threshold = 9. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.


[warning] 99-383: ❌ Getting worse: Complex Method
main increases in cyclomatic complexity from 55 to 59, threshold = 9. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.

⏰ Context from checks skipped due to timeout of 90000ms (11)
  • GitHub Check: pcsx-redux (aarch64-linux)
  • GitHub Check: pcsx-redux (x86_64-linux)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build-openbios
  • GitHub Check: macos-build-and-test-toolchain
  • GitHub Check: coverage
  • GitHub Check: aur-build
  • GitHub Check: asan
  • GitHub Check: cross-arm64
  • GitHub Check: toolchain
  • GitHub Check: build
🔇 Additional comments (6)
tools/authoring/authoring.cc (6)

99-99: Command line parsing looks correct.

The quiet flag is properly parsed from the command line arguments using the consistent pattern with other flags.


111-111: Help text accurately describes the new option.

The help text clearly indicates that -q will "only print errors", which correctly describes the quiet mode behavior.


204-206: Informational output correctly suppressed in quiet mode.

The index size information is appropriately wrapped with the quiet flag check, maintaining the intended behavior of only showing errors when quiet mode is enabled.


226-229: Executable information output properly controlled.

Both executable size and location information are correctly wrapped with quiet flag checks, ensuring consistency with the quiet mode implementation.


365-371: File processing details appropriately silenced.

The detailed file processing information (original size, compressed size, compression method, sector offset) is properly wrapped with the quiet flag check, which is important since this can be quite verbose during the build process.


381-383: Final summary output correctly controlled.

The total processed files count is appropriately wrapped with the quiet flag check, completing the consistent implementation of quiet mode throughout the tool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant