Skip to content
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

Added Box support #352

Merged
merged 16 commits into from
Sep 11, 2024
Merged

Added Box support #352

merged 16 commits into from
Sep 11, 2024

Conversation

iammajid
Copy link
Contributor

@iammajid iammajid commented Apr 18, 2024

Adds support for Box as a cloud provider. (WIP)

Copy link

coderabbitai bot commented Apr 18, 2024

Caution

Review failed

The pull request is closed.

Walkthrough

The recent changes integrate Box cloud storage into the Cryptomator application, enhancing support for Box accounts through authentication, credential management, and various structural updates. The project has been organized to accommodate these features, including updates to dependencies and modifications to class methods related to Box functionalities.

Changes

File(s) Change Summary
Cryptomator.xcodeproj/project.pbxproj, Cryptomator.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved Added cloud-access-swift reference and updated dependencies, including box-swift-sdk-gen and branch references.
Cryptomator/AppDelegate.swift, Cryptomator/Common/CloudAuthenticator.swift, Cryptomator/Common/CloudAccountList/AccountListViewModel.swift, Cryptomator/VaultDetail/VaultDetailInfoFooterViewModel.swift, Cryptomator/Common/CloudProviderDBManager.swift, Cryptomator/Common/CloudProviderType.swift Introduced Box integration in various methods for authentication and credential management.
Scripts/git-format-staged.py Updated script for Python 3 compatibility, added verbose parameter, and improved usage instructions.
Cryptomator/Resources/about.html, CryptomatorCommon/Package.swift Added documentation for Box Swift SDK and updated dependency version for cloud-access-swift.
CryptomatorCommon/Sources/CryptomatorCommonCore/Box/BoxTokenStorage.swift, CryptomatorCommon/Sources/CryptomatorCommonCore/CryptomatorKeychain.swift Introduced BoxTokenStorage for token management and added keychain service for Box.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant AppDelegate
    participant CloudAuthenticator
    participant BoxSdkGen
    participant BoxTokenStore
    User ->> AppDelegate: Launch App
    AppDelegate ->> BoxSdkGen: Initialize with clientId and clientSecret
    User ->> CloudAuthenticator: Authenticate Box
    CloudAuthenticator ->> BoxSdkGen: Perform Box Authentication
    BoxSdkGen ->> CloudAuthenticator: Return AccessToken
    CloudAuthenticator ->> BoxTokenStore: Store AccessToken
    BoxTokenStore ->> CloudAuthenticator: Token Stored
    CloudAuthenticator ->> User: Authentication Success
Loading

🐇
In the code, a rabbit hops,
Adding Box to storage swaps.
With tokens stored and secrets set,
Cloud access now without a fret.
Cryptomator's reach expands,
Secure files in Box's lands.
Hopping swift, the updates flow,
In the cloud, your data's stow.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

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>.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @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.

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 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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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

@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: 3

Actionable comments outside the diff hunks (1)
fastlane/scripts/create-cloud-access-secrets.sh (1)

Line range hint 5-5: Replace 'source' with '.' for better POSIX compliance.

-  source ./scripts/.cloud-access-secrets.sh "${1}"
+  . ./scripts/.cloud-access-secrets.sh "${1}"

Cryptomator/Settings/SettingsCoordinator.swift Outdated Show resolved Hide resolved
CryptomatorIntents/SaveFileIntentHandler.swift Outdated Show resolved Hide resolved
@iammajid iammajid changed the title Feature: S3 support Feature: Box support Apr 18, 2024
@tobihagemann tobihagemann linked an issue Apr 18, 2024 that may be closed by this pull request
2 tasks
@tobihagemann tobihagemann changed the title Feature: Box support Added Box support Apr 18, 2024
Cryptomator.xcodeproj/project.pbxproj Outdated Show resolved Hide resolved
fastlane/scripts/create-cloud-access-secrets.sh Outdated Show resolved Hide resolved
fastlane/scripts/create-cloud-access-secrets.sh Outdated Show resolved Hide resolved
tobihagemann and others added 4 commits April 18, 2024 18:36
# Conflicts:
#	Cryptomator.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
#	Cryptomator/AppDelegate.swift
#	CryptomatorCommon/Package.swift
#	CryptomatorCommon/Sources/CryptomatorCommonCore/Manager/CloudProviderDBManager.swift
#	FileProviderExtension/FileProviderExtension.swift
#	FileProviderExtensionUI/RootViewController.swift
Copy link

@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: 3

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 7758020 and dff8569.
Files selected for processing (5)
  • Cryptomator.xcodeproj/project.pbxproj (2 hunks)
  • Cryptomator.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved (1 hunks)
  • Cryptomator/AppDelegate.swift (2 hunks)
  • Cryptomator/Common/CloudAuthenticator.swift (3 hunks)
  • CryptomatorCommon/Sources/CryptomatorCommonCore/Box/BoxTokenStore.swift (1 hunks)
Files skipped from review due to trivial changes (1)
  • Cryptomator.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
Additional comments not posted (4)
CryptomatorCommon/Sources/CryptomatorCommonCore/Box/BoxTokenStore.swift (1)

16-40: The implementation of BoxTokenStore adheres to the TokenStorage protocol and provides methods for storing, retrieving, and clearing tokens. The error handling is consistent, and custom errors are thrown for specific keychain failures.

Cryptomator/AppDelegate.swift (1)

53-53: The setup for Box cloud service is correctly implemented using the provided client ID and secret. This is consistent with the setup patterns used for other cloud services in the app.

Cryptomator/Common/CloudAuthenticator.swift (2)

63-74: The authenticateBox method is well-integrated into the existing authentication framework. It uses a BoxTokenStore for token management and correctly handles the authentication flow. The method is asynchronous and uses promises, which is consistent with other cloud provider authentication methods in this class.


94-95: The integration of Box into the generic authenticate and deauthenticate methods is correctly implemented. This ensures that Box is treated similarly to other supported cloud providers, maintaining consistency in the application's cloud authentication strategy.

Also applies to: 115-118

Cryptomator.xcodeproj/project.pbxproj Outdated Show resolved Hide resolved
Cryptomator.xcodeproj/project.pbxproj Outdated Show resolved Hide resolved
Copy link

@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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between dff8569 and 0c05b70.

Files selected for processing (7)
  • Cryptomator.xcodeproj/project.pbxproj (2 hunks)
  • Cryptomator/Common/CloudAccountList/AccountListViewModel.swift (5 hunks)
  • Cryptomator/Common/CloudAuthenticator.swift (3 hunks)
  • Cryptomator/Settings/SettingsCoordinator.swift (1 hunks)
  • Cryptomator/VaultDetail/VaultDetailInfoFooterViewModel.swift (2 hunks)
  • CryptomatorCommon/Sources/CryptomatorCommonCore/Manager/CloudProviderDBManager.swift (2 hunks)
  • CryptomatorCommon/Sources/CryptomatorCommonCore/Manager/CloudProviderType.swift (1 hunks)
Additional comments not posted (14)
CryptomatorCommon/Sources/CryptomatorCommonCore/Manager/CloudProviderType.swift (1)

17-17: Addition of box case is appropriate.

The addition of the box case to the CloudProviderType enum is consistent with the PR's objective of adding Box support.

Cryptomator/VaultDetail/VaultDetailInfoFooterViewModel.swift (2)

47-51: Integration of Box in getUsername method is consistent.

The addition of the Box case in the getUsername method is consistent with the existing structure and supports the new cloud provider.


97-103: Addition of getUsername(for: BoxCredential) is well-implemented.

The new function getUsername(for: BoxCredential) is implemented in line with the existing pattern for other cloud providers.

Cryptomator/Settings/SettingsCoordinator.swift (1)

52-52: Addition of Box to cloud services list is appropriate.

The inclusion of Box in the clouds parameter of ChooseCloudViewModel aligns with the PR's objective and enhances the user experience by providing more cloud service options.

Cryptomator/Common/CloudAuthenticator.swift (3)

63-74: LGTM!

The authenticateBox function is implemented correctly and follows the existing pattern for other cloud providers.


94-95: LGTM!

The addition of the .box case in the authenticate function is consistent with the existing structure for other cloud providers.


115-118: LGTM!

The addition of the .box case in the deauthenticate function aligns with the existing logic for other cloud providers.

CryptomatorCommon/Sources/CryptomatorCommonCore/Manager/CloudProviderDBManager.swift (2)

78-81: LGTM!

The addition of the .box case in the createProvider function is consistent with the existing pattern for other cloud providers.


129-132: LGTM!

The addition of the .box case in the createBackgroundSessionProvider function aligns with the existing logic for other cloud providers.

Cryptomator/Common/CloudAccountList/AccountListViewModel.swift (5)

70-82: LGTM!

The refreshBoxItems function is implemented correctly and uses promises for asynchronous handling.


87-97: LGTM!

The modification to return a placeholder for Box accounts in createAccountCellContent is consistent with the handling of other cloud providers.


114-116: LGTM!

The createAccountCellContentPlaceholder function is straightforward and correctly implemented.


140-143: LGTM!

The createAccountCellContent function for BoxCredential is implemented correctly and uses promises for asynchronous handling.


40-40: Verify memory management for boxCredentials.

Ensure that the lifecycle of boxCredentials is properly managed to avoid potential memory retention issues.

Run the following script to verify memory management practices:

Copy link

@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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 0c05b70 and cb1e411.

Files selected for processing (2)
  • Cryptomator.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved (1 hunks)
  • CryptomatorCommon/Package.swift (1 hunks)
Additional comments not posted (3)
CryptomatorCommon/Package.swift (1)

29-29: Consider the implications of using a branch-based dependency.

Switching from a fixed version to a branch-based dependency (develop) for cloud-access-swift can introduce instability if the branch contains untested or experimental code. Ensure that the branch is stable and regularly tested.

To verify the stability of the develop branch, you might want to check the branch's commit history and test coverage.

Cryptomator.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved (2)

57-65: Verify the compatibility of the new box-swift-sdk-gen dependency.

Ensure that the new dependency box-swift-sdk-gen is compatible with the existing codebase and does not introduce conflicts with other dependencies.

Consider running a dependency compatibility check or reviewing the documentation for potential issues.


71-72: Ensure consistency with Package.swift for cloud-access-swift.

The cloud-access-swift dependency is now using a branch reference (develop). Ensure this is consistent with the Package.swift file and verify that the branch is stable.

Copy link

@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: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between cb1e411 and 7caffbd.

Files selected for processing (14)
  • Cryptomator.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved (6 hunks)
  • Cryptomator/AppDelegate.swift (1 hunks)
  • Cryptomator/Common/CloudAccountList/AccountListViewController.swift (3 hunks)
  • Cryptomator/Common/CloudAccountList/AccountListViewModel.swift (4 hunks)
  • Cryptomator/Common/CloudAuthenticator.swift (2 hunks)
  • Cryptomator/Common/CloudProviderType+Localization.swift (1 hunks)
  • Cryptomator/Common/UIImage+CloudProviderType.swift (2 hunks)
  • Cryptomator/Settings/SettingsCoordinator.swift (1 hunks)
  • Cryptomator/VaultDetail/VaultDetailInfoFooterViewModel.swift (3 hunks)
  • CryptomatorCommon/Sources/CryptomatorCommonCore/Box/BoxTokenStorage.swift (1 hunks)
  • CryptomatorCommon/Sources/CryptomatorCommonCore/CryptomatorKeychain.swift (1 hunks)
  • CryptomatorCommon/Sources/CryptomatorCommonCore/Manager/CloudProviderDBManager.swift (2 hunks)
  • CryptomatorCommon/Sources/CryptomatorCommonCore/Manager/CloudProviderType.swift (1 hunks)
  • CryptomatorIntents/SaveFileIntentHandler.swift (1 hunks)
Files skipped from review as they are similar to previous changes (5)
  • Cryptomator.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
  • Cryptomator/Common/CloudAccountList/AccountListViewModel.swift
  • Cryptomator/Common/CloudAuthenticator.swift
  • Cryptomator/Settings/SettingsCoordinator.swift
  • CryptomatorCommon/Sources/CryptomatorCommonCore/Manager/CloudProviderType.swift
Additional context used
Learnings (2)
CryptomatorCommon/Sources/CryptomatorCommonCore/Box/BoxTokenStorage.swift (1)
Learnt from: iammajid
PR: cryptomator/ios#352
File: CryptomatorCommon/Sources/CryptomatorCommonCore/Box/BoxTokenStore.swift:43-67
Timestamp: 2024-06-24T07:17:45.973Z
Learning: The hardcoded key "foo" in `CryptomatorKeychain` methods for handling Box token information is acknowledged by the user and is kept unchanged for now.
CryptomatorCommon/Sources/CryptomatorCommonCore/CryptomatorKeychain.swift (1)
Learnt from: iammajid
PR: cryptomator/ios#352
File: CryptomatorCommon/Sources/CryptomatorCommonCore/Box/BoxTokenStore.swift:43-67
Timestamp: 2024-06-24T07:17:45.973Z
Learning: The hardcoded key "foo" in `CryptomatorKeychain` methods for handling Box token information is acknowledged by the user and is kept unchanged for now.
Additional comments not posted (24)
Cryptomator/Common/CloudProviderType+Localization.swift (2)

15-16: Addition of Box case in localizedString().

The addition of the .box case is consistent with the existing pattern for other cloud providers. This change enhances the localization support for Box.


21-22: Reordering and handling of .localFileSystem.

The reordering of the .localFileSystem case improves the organization of the code. The call to localizedString() on localFileSystemType is appropriate and maintains consistency.

Cryptomator/Common/UIImage+CloudProviderType.swift (4)

21-22: Addition of Box case in vaultIconFor.

The addition of the .box case with the asset name "box-vault" is consistent with the existing pattern for other cloud providers. This change enhances the icon support for Box.


27-28: Reordering and handling of .localFileSystem in vaultIconFor.

The reordering of the .localFileSystem case and the use of UIImage.getVaultIcon(for:) improves the organization and clarity of the code.


56-57: Addition of Box case in storageIconFor.

The addition of the .box case with the asset name "box" is consistent with the existing pattern for other cloud providers. This change enhances the icon support for Box.


62-63: Reordering and handling of .localFileSystem in storageIconFor.

The reordering of the .localFileSystem case and the use of UIImage.getStorageIcon(for:) improves the organization and clarity of the code.

CryptomatorCommon/Sources/CryptomatorCommonCore/Box/BoxTokenStorage.swift (5)

12-22: Introduction of BoxTokenStorage class.

The BoxTokenStorage class is well-structured and implements the TokenStorage protocol. The use of didSet for userID to handle pending tokens is a thoughtful design choice.

Tools
SwiftLint

[Warning] 15-15: Prefer != nil over let _ =

(unused_optional_binding)


30-36: Implementation of store(token:).

The store(token:) method correctly handles the absence of userID by storing the token as pending. The use of CryptomatorKeychain for saving tokens is appropriate.


38-46: Implementation of get().

The get() method efficiently retrieves a pending token or fetches it from the keychain. The logic is clear and handles the absence of userID gracefully.


48-53: Implementation of clear().

The clear() method correctly deletes the token from the keychain if userID is present. The logic is straightforward and effective.


56-77: Extension of CryptomatorKeychain for Box tokens.

The extension methods for handling Box tokens in CryptomatorKeychain are well-implemented. They provide clear and concise methods for token management.

Cryptomator/VaultDetail/VaultDetailInfoFooterViewModel.swift (4)

47-51: Box integration in getUsername looks good.

The changes correctly integrate Box as a cloud provider.


97-103: Asynchronous username retrieval for Box is well-implemented.

The function is consistent with similar functions for other providers.


Line range hint 83-87: No changes detected in getUsername(for credential: DropboxCredential).

The function is consistent with the new Box implementation.


Line range hint 91-95: No changes detected in getUsername(for credential: PCloudCredential).

The function is consistent with the new Box implementation.

CryptomatorCommon/Sources/CryptomatorCommonCore/CryptomatorKeychain.swift (1)

26-26: Addition of box property is consistent and enhances functionality.

The new static property box is consistent with other cloud providers and enhances the functionality of the CryptomatorKeychain class.

Cryptomator/AppDelegate.swift (1)

52-52: Box setup in AppDelegate is consistent and enhances capability.

The addition of Box setup is consistent with other cloud storage services and enhances the application's capability to support Box.

CryptomatorIntents/SaveFileIntentHandler.swift (1)

126-127: Addition of Box Asset Name

The .box case has been correctly added to return "box-vault", aligning with the integration of Box as a cloud provider. Ensure that this asset name is used consistently across the application.

Cryptomator/Common/CloudAccountList/AccountListViewController.swift (2)

16-16: Conformance to ASWebAuthenticationPresentationContextProviding

The class now conforms to ASWebAuthenticationPresentationContextProviding, which is necessary for handling web authentication sessions. This is a good addition for supporting Box authentication.


143-143: Addition of Box Case in supportsEditing

The .box case has been added to the supportsEditing function, which correctly reflects the editing support logic for Box accounts.

CryptomatorCommon/Sources/CryptomatorCommonCore/Manager/CloudProviderDBManager.swift (4)

65-68: Addition of Box Provider Creation

The .box case has been added to the provider creation method, correctly initializing the BoxCloudProvider with the necessary credentials. This aligns with the Box integration.


87-89: Addition of S3 Provider Creation

The .s3 case has been added to the provider creation method, initializing the S3CloudProvider with the appropriate credentials. This change supports the integration of S3.


116-119: Addition of Box Background Session Provider

The .box case has been added to the background session creation method, using BoxCloudProvider.withBackgroundSession. This is a correct implementation for handling background sessions with Box.


138-140: Addition of S3 Background Session Provider

The .s3 case has been added to the background session creation method, using S3CloudProvider.withBackgroundSession. This addition is consistent with the S3 integration.

Copy link

@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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 7caffbd and ef94077.

Files selected for processing (3)
  • Cryptomator/Common/CloudAccountList/AccountListViewModel.swift (3 hunks)
  • Cryptomator/Common/CloudAuthenticator.swift (2 hunks)
  • CryptomatorCommon/Sources/CryptomatorCommonCore/Box/BoxTokenStorage.swift (1 hunks)
Files skipped from review as they are similar to previous changes (3)
  • Cryptomator/Common/CloudAccountList/AccountListViewModel.swift
  • Cryptomator/Common/CloudAuthenticator.swift
  • CryptomatorCommon/Sources/CryptomatorCommonCore/Box/BoxTokenStorage.swift

Copy link

@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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between ef94077 and f631e5c.

Files selected for processing (2)
  • Cryptomator.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved (6 hunks)
  • Cryptomator/Common/CloudAccountList/AccountListViewController.swift (3 hunks)
Files skipped from review as they are similar to previous changes (1)
  • Cryptomator.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
Additional comments not posted (2)
Cryptomator/Common/CloudAccountList/AccountListViewController.swift (2)

110-115: Improved error handling in presentationAnchor.

The method now logs a message instead of using fatalError, which prevents the app from crashing if no window is found. This is a good practice for enhancing app stability.


145-145: Updated editing support for Box.

The addition of .box to the list of cloud providers that do not support editing aligns with the new Box integration.

Copy link

@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: 1

Outside diff range, codebase verification and nitpick comments (1)
Scripts/git-format-staged.py (1)

40-40: The verbose parameter is not utilized in the current codebase.

The verbose parameter has been added to the function signature but is not being used in the function call within Scripts/git-format-staged.py. Consider reviewing its necessity or implementing its usage where appropriate.

  • Location: Scripts/git-format-staged.py
    • Function definition includes verbose parameter.
    • Function call does not utilize verbose.
Analysis chain

Addition of verbose parameter is beneficial.

The verbose parameter enhances the script by allowing detailed logging, which is useful for debugging.

Ensure that the verbose parameter is correctly used throughout the codebase.

Run the following script to verify the usage of the verbose parameter:

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `format_staged_files` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type python -A 5 $'format_staged_files'

Length of output: 74


Script:

#!/bin/bash
# Description: Verify all function calls to `format_staged_files` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg -A 5 $'format_staged_files'

Length of output: 944

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between f631e5c and 53006fb.

Files selected for processing (1)
  • Scripts/git-format-staged.py (11 hunks)
Additional context used
Ruff
Scripts/git-format-staged.py

24-24: gettext.gettext imported but unused

Remove unused import: gettext.gettext

(F401)

Additional comments not posted (5)
Scripts/git-format-staged.py (5)

1-1: Shebang line update is appropriate.

The change to explicitly require Python 3 is a good practice for ensuring compatibility with modern Python versions.


65-65: Addition of verbose parameter is consistent.

The verbose parameter is consistent with the changes in format_staged_files and allows for detailed logging.


94-101: Verbose logging enhances command execution transparency.

The addition of a verbose parameter and logic to print the command being executed improves the transparency and debuggability of the script.


90-90: Use of raw string notation for regex is appropriate.

The change to use raw string notation for regular expressions improves readability and prevents potential issues with escape sequences.

Also applies to: 171-171, 189-189


261-265: Addition of --verbose flag is beneficial.

The --verbose flag allows users to enable detailed logging, enhancing the user experience by providing more context during execution.

import os
import re
import subprocess
import sys
from fnmatch import fnmatch
from gettext import gettext as _
Copy link

Choose a reason for hiding this comment

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

Remove unused import.

The gettext.gettext import is not used in the script and should be removed to clean up the code.

Apply this diff to remove the unused import:

-from gettext import gettext as _
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
from gettext import gettext as _
Tools
Ruff

24-24: gettext.gettext imported but unused

Remove unused import: gettext.gettext

(F401)

Copy link

@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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 53006fb and c68e09b.

Files selected for processing (1)
  • Cryptomator/Resources/about.html (1 hunks)
Files skipped from review due to trivial changes (1)
  • Cryptomator/Resources/about.html

@tobihagemann tobihagemann merged commit 80a1670 into develop Sep 11, 2024
1 of 3 checks passed
@tobihagemann tobihagemann deleted the feature/Box-support branch September 11, 2024 15:28
@tobihagemann tobihagemann added this to the 2.6.0 milestone Sep 12, 2024
This pull request was closed.
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.

Add Box support
2 participants