Skip to content

Conversation

@zenangst
Copy link
Owner

No description provided.

@github-actions
Copy link

@github-actions
Copy link

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR applies automated code formatting to the Swift codebase using swiftformat, standardizing the placement of opening braces and indentation throughout the project.

Changes:

  • Moved opening braces from new lines to the end of function/initializer/type declarations
  • Adjusted indentation in #if DEBUG sections for consistency
  • Applied formatting to over 150 files across the codebase

Reviewed changes

Copilot reviewed 162 out of 166 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
UnitTests/Sources/*.swift Updated test file initializer formatting
App/Sources/UI/Windows/*.swift Standardized window class initializer brace positioning
App/Sources/UI/Views/**/*.swift Formatted all view initializers and computed properties
App/Sources/UI/Stores/*.swift Adjusted DEBUG section indentation
App/Sources/Core/**/*.swift Formatted core functionality initializers and functions
Packages/RingBuffer/Sources/RingBuffer/*.swift Applied formatting to package code

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +13 to 16
checkCancellation: Bool) async throws -> String? {
let source = """
shortcuts run "\(command.shortcutIdentifier)"
"""
Copy link

Copilot AI Jan 10, 2026

Choose a reason for hiding this comment

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

The ShortcutsCommandRunner.run method builds a shell script line shortcuts run "\(command.shortcutIdentifier)" via string interpolation and then executes it through the shell, which allows shell command injection if shortcutIdentifier contains quotes or other shell metacharacters. Because shortcutIdentifier is loaded from configuration (and thus can be altered by imported or edited configs), an attacker can craft a value like Shortcut"; rm -rf ~; echo "x" so that when this command executes, the injected shell commands run with the user's privileges. To mitigate this, avoid embedding shortcutIdentifier directly into a shell script string; instead, either escape it robustly for the shell context or invoke the shortcuts tool with it passed as a separate process argument rather than as part of a script line.

Copilot uses AI. Check for mistakes.
Copy link
Owner Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

@github-actions
Copy link

@zenangst zenangst merged commit 6a04e90 into main Jan 10, 2026
1 check passed
Copy link
Contributor

Copilot AI commented Jan 10, 2026

@zenangst I've opened a new pull request, #691, to work on those changes. Once the pull request is ready, I'll request review from you.

@zenangst zenangst deleted the swift/format branch January 10, 2026 13:35
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