-
Notifications
You must be signed in to change notification settings - Fork 1
chore: Comprehensive configuration updates and test improvements #54
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
Closed
Closed
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
490517c
chore(quality): Enhance all quality tool configurations
MarjovanLier af7ba7e
chore(coderabbit): Add YAML document separator at top
MarjovanLier 448a2ca
fix(coderabbit): Remove 6th custom check to meet schema limit
MarjovanLier 70c03c1
chore(yamllint): Fix line length violations in CodeRabbit config
MarjovanLier 27e50af
refactor(config): Improve wording in CodeRabbit configuration
MarjovanLier 63280fe
feat(quality): Add type-perfect and type-coverage
MarjovanLier 2743269
refactor(quality): Enable all type_perfect no_mixed checks
MarjovanLier 880951d
fix(types): Add array type to callback parameter
MarjovanLier 4742d73
fix(style): Rename property to camelCase per PHPMD
MarjovanLier 51c6490
refactor(psalm): Remove baseline and exclude tests
MarjovanLier dcdb681
refactor(tests): Convert PHP annotations to attributes
MarjovanLier 961e7f6
refactor(tests): Migrate from PHPUnit to Pest framework
MarjovanLier 8633f42
chore(tests): Increase mutation score requirement to 90%
MarjovanLier 974b047
feat(tests): Add Pest coverage and improve mutations
MarjovanLier 964dc02
feat(tests): Improve mutation score with targeted tests
MarjovanLier 7e07008
refactor(tests): Improve mutation score to 86.23%
MarjovanLier 0ca665c
refactor: Remove redundant str_contains check in nameFix
MarjovanLier 5e09cf3
refactor: Remove redundant str_contains check for mac prefix
MarjovanLier 6bfc508
refactor(tests): Address CodeRabbit review findings
MarjovanLier 2d3ee25
refactor(tests): Address additional CodeRabbit findings
MarjovanLier 22425f2
chore(ci): Migrate from PHPUnit to Pest
MarjovanLier 8b32c34
chore(merge): Integrate main branch changes
MarjovanLier File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,245 @@ | ||
| language: "en" | ||
| --- | ||
| # yaml-language-server: $schema=https://docs.coderabbit.ai/schema/schema.v2.json | ||
|
|
||
| # CodeRabbit Configuration | ||
| # StringManipulation PHP 8.3+ Library | ||
| # Enforces strict quality standards: PHPStan MAX, SOLID principles, PER-CS2.0 | ||
|
|
||
| # Language and Tone | ||
| language: en-ZA | ||
| early_access: true | ||
| tone_instructions: "You're an expert PHP reviewer, proficient in PER Coding Style 2.0 (extending PSR-12 & PSR-1), SOLID, and FOOP. Advise on immutable data, pure functions, and functional composition while ensuring robust OOP. Provide concise, actionable feedback." | ||
| tone_instructions: >- | ||
| Expert PHP reviewer proficient in PER Coding Style 2.0, SOLID, and FOOP. | ||
| Advise on immutable data, pure functions, and functional composition. | ||
| Provide concise, actionable feedback. | ||
|
|
||
| # Review configuration | ||
| reviews: | ||
| request_changes_workflow: true | ||
| high_level_summary: true | ||
| poem: false | ||
| review_status: true | ||
| collapse_walkthrough: true | ||
| auto_review: | ||
| enabled: true | ||
| ignore_title_keywords: | ||
| - "WIP" | ||
| - "DO NOT MERGE" | ||
| drafts: false | ||
| base_branches: | ||
| - "develop" | ||
| - "feat/.*" | ||
| - "main" | ||
| path_instructions: | ||
| - path: "**/*.php" | ||
| instructions: | | ||
| Review PHP code for adherence to PER Coding Style 2.0 guidelines. Ensure proper namespace usage, code organisation, and separation of concerns. Verify that SOLID principles are followed and encourage FOOP techniques—such as employing immutable data, pure functions, and functional composition—to improve maintainability, testability, and performance. | ||
| # Review profile and behaviour | ||
| profile: "assertive" | ||
| request_changes_workflow: true | ||
| high_level_summary: true | ||
| high_level_summary_placeholder: "@coderabbitai summary" | ||
| poem: false | ||
| review_status: true | ||
| commit_status: true | ||
| fail_commit_status: false | ||
| collapse_walkthrough: true | ||
|
|
||
| # Walkthrough features | ||
| changed_files_summary: true | ||
| sequence_diagrams: true | ||
| estimate_code_review_effort: true | ||
| assess_linked_issues: true | ||
| related_issues: true | ||
| related_prs: true | ||
| suggested_labels: true | ||
| auto_apply_labels: false | ||
| suggested_reviewers: true | ||
| auto_assign_reviewers: false | ||
|
|
||
| # Path filters (exclude generated files, vendor, etc.) | ||
| path_filters: | ||
| - "!vendor/**" | ||
| - "!reports/**" | ||
| - "!node_modules/**" | ||
| - "!*.lock" | ||
| - "src/**" | ||
| - "tests/**" | ||
|
|
||
| # Path-specific instructions | ||
| path_instructions: | ||
| - path: "**/*.php" | ||
| instructions: | | ||
| Review PHP code for adherence to PER Coding Style 2.0 guidelines. | ||
| Ensure proper namespace usage, code organisation, and separation | ||
| of concerns. Verify that SOLID principles are followed and | ||
| encourage FOOP techniques—such as immutable data, pure functions, | ||
| and functional composition—to improve maintainability, | ||
| testability, and performance. | ||
|
|
||
| Specific checks: | ||
| - Strict typing: `declare(strict_types=1);` is required | ||
| - Explicit type declarations for all parameters and return types | ||
| - Final classes with static methods where appropriate | ||
| - Comprehensive docblocks with @param, @return, and @example tags | ||
| - No methods exceeding 100 lines (PHPMD rule) | ||
| - PHP 8.3+ features and patterns | ||
| - Proper error handling and null safety | ||
|
|
||
| - path: "tests/**/*.php" | ||
| instructions: | | ||
| Review test code for: | ||
| - TDD compliance (tests should be clear and comprehensive) | ||
| - PHPUnit best practices | ||
| - 100% coverage for critical paths, 90%+ for standard code | ||
| - Fast execution (unit tests <100ms, integration <5s) | ||
| - Independent, deterministic tests | ||
| - Descriptive test names and clear assertions | ||
| - Proper mocking and test isolation | ||
|
|
||
| # Automatic review settings | ||
| auto_review: | ||
| enabled: true | ||
| auto_incremental_review: true | ||
| ignore_title_keywords: | ||
| - "WIP" | ||
| - "DO NOT MERGE" | ||
| - "DRAFT" | ||
| drafts: false | ||
| base_branches: | ||
| - "main" | ||
| - "develop" | ||
| - "feat/.*" | ||
| - "fix/.*" | ||
| - "refactor/.*" | ||
|
|
||
| # Finishing touches | ||
| finishing_touches: | ||
| docstrings: | ||
| enabled: true | ||
| unit_tests: | ||
| enabled: true | ||
|
|
||
| # Pre-merge checks | ||
| pre_merge_checks: | ||
| docstrings: | ||
| mode: "error" | ||
| threshold: 80 | ||
|
|
||
| title: | ||
| mode: "warning" | ||
| requirements: "Follow conventional commits format: type(scope): description. Types: feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert|security|deps|config|release" | ||
|
|
||
| description: | ||
| mode: "warning" | ||
|
|
||
| issue_assessment: | ||
| mode: "warning" | ||
|
|
||
| custom_checks: | ||
| - mode: "error" | ||
| name: "Strict Type Declarations" | ||
| instructions: "All PHP files in src/ must begin with `declare(strict_types=1);` after the opening PHP tag and before the namespace declaration." | ||
|
|
||
| - mode: "error" | ||
| name: "No Debugging Functions" | ||
| instructions: "Production code (src/ directory) must not contain debugging functions: var_dump(), var_export(), print_r(), dd(), or dump()." | ||
|
|
||
| - mode: "warning" | ||
| name: "Test Coverage" | ||
| instructions: "New code must have corresponding PHPUnit tests. Critical features require 100% line coverage; standard features require 90% coverage." | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| - mode: "warning" | ||
| name: "Performance Complexity" | ||
| instructions: "Algorithms should avoid O(n²) or worse time complexity. Document Big O time complexity for non-trivial algorithms." | ||
|
|
||
| - mode: "warning" | ||
| name: "Security Best Practices" | ||
| instructions: "Validate all user input. Use parameterised statements for SQL queries. Never hardcode secrets, credentials, or API keys." | ||
|
|
||
| # Tools configuration | ||
| tools: | ||
| # GitHub Checks - MAX TIMEOUT (15 minutes) | ||
| github-checks: | ||
| enabled: true | ||
| timeout_ms: 900000 | ||
|
|
||
| # PHP Tools | ||
| phpstan: | ||
| enabled: true | ||
| level: "max" | ||
|
|
||
| phpmd: | ||
| enabled: true | ||
|
|
||
| phpcs: | ||
| enabled: true | ||
|
|
||
| # Security and quality tools | ||
| gitleaks: | ||
| enabled: true | ||
|
|
||
| actionlint: | ||
| enabled: true | ||
|
|
||
| semgrep: | ||
| enabled: true | ||
|
|
||
| # Documentation and style | ||
| languagetool: | ||
| enabled: true | ||
| level: "default" | ||
| enabled_only: false | ||
|
|
||
| # Disable non-PHP tools to reduce noise | ||
| shellcheck: | ||
| enabled: false | ||
|
|
||
| ruff: | ||
| enabled: false | ||
|
|
||
| eslint: | ||
| enabled: false | ||
|
|
||
| yamllint: | ||
| enabled: true | ||
|
|
||
| # Chat configuration | ||
| chat: | ||
| auto_reply: true | ||
| auto_reply: true | ||
| art: true | ||
|
|
||
| # Knowledge base | ||
| knowledge_base: | ||
| opt_out: false | ||
|
|
||
| web_search: | ||
| enabled: true | ||
|
|
||
| code_guidelines: | ||
| enabled: true | ||
| filePatterns: | ||
| - "**/CLAUDE.md" | ||
| - "**/.cursorrules" | ||
| - ".github/copilot-instructions.md" | ||
| - "docs/coding-standards.md" | ||
|
|
||
| learnings: | ||
| scope: "auto" | ||
|
|
||
| issues: | ||
| scope: "local" | ||
|
|
||
| pull_requests: | ||
| scope: "local" | ||
|
|
||
| # Code Generation Configuration | ||
| code_generation: | ||
| # Docstring Generation | ||
| docstrings: | ||
| language: en-ZA | ||
| path_instructions: | ||
| - path: "src/**/*.php" | ||
| instructions: | | ||
| Focus on explaining business behaviour and functionality, not obvious implementation. | ||
| Use South African English spelling (organisation, optimisation, analyse, behaviour). | ||
| Include @param and @return tags with proper types. | ||
| Add @throws for exceptions. | ||
| Add @example tags demonstrating usage. | ||
| Reference related documentation with @see tags. | ||
| Follow PER Coding Style 2.0 conventions. | ||
|
|
||
| # Unit Test Generation | ||
| unit_tests: | ||
| path_instructions: | ||
| - path: "src/**/*.php" | ||
| instructions: | | ||
| Generate PHPUnit tests following TDD principles: | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| - Test names must describe behaviour: test_methodName_condition_expectedBehaviour | ||
| - Each test must follow the AAA pattern (Arrange-Act-Assert) | ||
| - Include unit tests for all public methods, edge cases, and error conditions | ||
| - Tests must be independent and deterministic | ||
| - Target fast execution (<100ms for unit tests) | ||
| - Use data providers with #[DataProvider] for testing multiple scenarios | ||
| - Focus on critical functionality and edge cases | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| root = true | ||
|
|
||
| [*] | ||
| charset = utf-8 | ||
| end_of_line = lf | ||
| insert_final_newline = true | ||
| indent_style = space | ||
| indent_size = 4 | ||
| trim_trailing_whitespace = true | ||
|
|
||
| [*.{yml,yaml,json}] | ||
| indent_size = 2 | ||
|
|
||
| [*.md] | ||
| trim_trailing_whitespace = false | ||
|
|
||
| [Makefile] | ||
| indent_style = tab |
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
The instructions for test code review mention
PHPUnit best practices, but the project has been migrated to Pest. This should be updated toPest best practicesfor consistency.- Pest best practices