-
Notifications
You must be signed in to change notification settings - Fork 1
Apply nextcloud coding standards #235
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
Conversation
ef5eeac to
d6b3292
Compare
There was a problem hiding this 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 pull request applies Nextcloud coding standards to the codebase, primarily focusing on license header compliance and code style consistency. The changes include adding SPDX license headers to all files, updating coding standards configurations, reorganizing some code structure, and making minor version updates.
- Adds SPDX license headers (AGPL-3.0-or-later) to all source files and license files for assets
- Updates PHP coding standards configuration and applies formatting improvements
- Reorganizes some code structure and adds missing override attributes
- Updates dependency versions and development tooling
Reviewed Changes
Copilot reviewed 93 out of 100 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/**/*.php | Added SPDX headers and applied coding standards formatting |
| src/**/*.js | Added SPDX headers and minor formatting improvements |
| tests/**/*.php | Added SPDX headers and updated test formatting |
| img/**/*.license | Added license files for image assets |
| .php-cs-fixer.dist.php | New coding standards configuration file |
| composer.json | Updated dependency versions and scripts |
| Various config files | Added SPDX headers and minor updates |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| case 'Pup': | ||
| showWarning(t('gdatavaas', 'The file "' + file.basename + '" has been scanned with G DATA as verdict PUP (Potentially unwanted program)')); | ||
| showWarning(t('gdatavaas', 'The file "' + file.basename + '" has been scanned with G DATA as ' + | ||
| 'verdict PUP (Potentially unwanted program)')); |
Copilot
AI
Aug 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] String concatenation should use template literals for better readability. Consider using: showWarning(t('gdatavaas', \The file "${file.basename}" has been scanned with G DATA as verdict PUP (Potentially unwanted program)`))`
| 'verdict PUP (Potentially unwanted program)')); | |
| showWarning(t('gdatavaas', `The file "${file.basename}" has been scanned with G DATA as verdict PUP (Potentially unwanted program)`)); |
| use OCA\GDataVaas\AppInfo\Application; | ||
| use OCA\GDataVaas\Service\FileService; | ||
| use OCA\GDataVaas\Service\TagService; | ||
| use OCA\GDataVaas\Service\VerdictService; |
Copilot
AI
Aug 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Import statements should be grouped with framework imports before application imports. The TestLogger import should come after the OCA\GDataVaas imports.
| use OCA\GDataVaas\Service\VerdictService; | |
| use OCA\GDataVaas\AppInfo\Application; | |
| use OCA\GDataVaas\Service\FileService; | |
| use OCA\GDataVaas\Service\TagService; | |
| use OCA\GDataVaas\Service\VerdictService; | |
| use ColinODell\PsrTestLogger\TestLogger; |
| namespace OCA\GDataVaas\Service; | ||
|
|
||
| use Exception; | ||
| use OC\User\NoUserException; |
Copilot
AI
Aug 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Import of OC\User\NoUserException should be grouped with other OC imports and placed before OCA imports to follow typical import ordering conventions.
| $this->logger->error("Failed to scan uploaded file '{$node->getName()}' with ID '{$node->getId()}': {$e->getMessage()}"); | ||
| $this->logger->error( | ||
| "Failed to scan uploaded file '{$node->getName()}' with | ||
| ID '{$node->getId()}': {$e->getMessage()}" |
Copilot
AI
Aug 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The error message spans multiple lines in an inconsistent way. Consider using a single concatenated string or proper multi-line string formatting for better readability.
| ID '{$node->getId()}': {$e->getMessage()}" | |
| "Failed to scan uploaded file '{$node->getName()}' with ID '{$node->getId()}': {$e->getMessage()}" |
| } | ||
| return new JSONResponse( | ||
| ['error' => "An unexpected error occurred while scanning file $fileId with GData VaaS. Please | ||
| check the logs for more information and contact your administrator."], 500); |
Copilot
AI
Aug 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Long error message string is split across multiple lines inconsistently. Consider using a single string or proper multi-line string formatting for better readability.
| check the logs for more information and contact your administrator."], 500); | |
| ['error' => "An unexpected error occurred while scanning file $fileId with GData VaaS. Please check the logs for more information and contact your administrator."], 500); |
| ['name' => 'settings#getSendMailSummaryOfMaliciousFiles', 'url' | ||
| => '/getSendMailSummaryOfMaliciousFiles', 'verb' => 'GET'], | ||
| ['name' => 'settings#setSendMailSummaryOfMaliciousFiles', 'url' | ||
| => '/setSendMailSummaryOfMaliciousFiles', 'verb' => 'POST'] |
Copilot
AI
Aug 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Array formatting is inconsistent with line breaks in the middle of array elements. Consider keeping each complete array element on a single line or use consistent multi-line formatting.
| => '/setSendMailSummaryOfMaliciousFiles', 'verb' => 'POST'] | |
| ['name' => 'settings#getSendMailSummaryOfMaliciousFiles', 'url' => '/getSendMailSummaryOfMaliciousFiles', 'verb' => 'GET'], | |
| ['name' => 'settings#setSendMailSummaryOfMaliciousFiles', 'url' => '/setSendMailSummaryOfMaliciousFiles', 'verb' => 'POST'] |
| $appConfig->method( | ||
| 'getValueBool')->with(Application::APP_ID, | ||
| 'disableUnscannedTag')->willReturn(true | ||
| ); |
Copilot
AI
Aug 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Method call is unnecessarily split across multiple lines with inconsistent indentation. Consider using a single line or proper multi-line formatting with consistent indentation.
| ); | |
| $appConfig | |
| ->method('getValueBool') | |
| ->with(Application::APP_ID, 'disableUnscannedTag') | |
| ->willReturn(true); |
6620904 to
e9f33ed
Compare
e9f33ed to
01b81e9
Compare
* fix: correct syntax error in ScanService.php for constant declaration for PHP < 8.3 (#227) * chore(deps): update dependency webpack-dev-server to v5.2.2 (#225) Co-authored-by: Renovate Bot <[email protected]> * chore(deps): update all non-major dependencies (#231) Co-authored-by: Renovate Bot <[email protected]> * chore(deps): update dependency psalm/phar to v6.13.0 (#232) Co-authored-by: Renovate Bot <[email protected]> * chore(deps): update all non-major dependencies (#233) Co-authored-by: Renovate Bot <[email protected]> * Add a quicker way for development with a local Nextcloud server and the app code changeable inside this server (#234) * Add Nextclouds worklfow templates and apply Nextcloud coding style (#235) * Add maximum scan size setting for file uploads (#236) * Devcontainer and Workflow Performance (#237) - Faster local development in devcontainer - Add Make stages for local fast developing as well as unit and bats tests - Remove unmaintained files from old debugging sessions` - Cleanup unused files and bundle utility scripts * Settings improvements (#238) - Add button to test current vaas configuration - Rename app settings to be more intuitive * Add additional settings (#239) - Control scan timeout - Control usage of cache - Control usage of hash lookup * Refactor logging messages and remove redundant debug statements (#240) * Update README with development environment setup instructions (#241) * Remove unused settings (#242) - Malicious file notifications summary - Scan only new files * Add make target for production like local setup (#243) * Outsource file scan actions (#244) --------- Co-authored-by: vaas-bot <[email protected]> Co-authored-by: Renovate Bot <[email protected]>
* fix: correct syntax error in ScanService.php for constant declaration for PHP < 8.3 (#227) * Add a quicker way for development with a local Nextcloud server and the app code changeable inside this server (#234) * Add Nextclouds worklfow templates and apply Nextcloud coding style (#235) * Add maximum scan size setting for file uploads (#236) * Devcontainer and Workflow Performance (#237) - Faster local development in devcontainer - Add Make stages for local fast developing as well as unit and bats tests - Remove unmaintained files from old debugging sessions` - Cleanup unused files and bundle utility scripts * Settings improvements (#238) - Add button to test current vaas configuration - Rename app settings to be more intuitive * Add additional settings (#239) - Control scan timeout - Control usage of cache - Control usage of hash lookup * Refactor logging messages and remove redundant debug statements (#240) * Update README with development environment setup instructions (#241) * Remove unused settings (#242) - Malicious file notifications summary - Scan only new files * Add make target for production like local setup (#243) * Outsource file scan actions (#244)
No description provided.