-
Notifications
You must be signed in to change notification settings - Fork 1
Extract RuleTestCase from shipmonk/phpstan-rules #1
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
Merged
Merged
Changes from 7 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
53b81aa
Extract RuleTestCase from shipmonk/phpstan-rules
JanTvrdik d7a0419
Add MIT License
JanTvrdik 059292c
Fix deprecated PHPCS configuration syntax
JanTvrdik 40e3f40
Remove shipmonk identifier requirement from RuleTestCase
JanTvrdik 88521d5
Add PSR-4 autoload-dev configuration for tests
JanTvrdik af5b783
Add comprehensive test suite with example rule
JanTvrdik 73c2fd4
Enhance RuleTestCase to support multiple errors on same line
JanTvrdik cffc3e9
Update GitHub Actions checkout to v4
JanTvrdik c13b0b2
Add tests directory to PHPStan analysis
JanTvrdik 88eb8c1
Add PHP version matrix to checks workflow
JanTvrdik 26e630b
Update README with comprehensive testing documentation
JanTvrdik bbfb406
Add composer.lock to gitignore and remove from repository
JanTvrdik e644310
Add PHPUnit dependency for testing framework
JanTvrdik 3276bae
Refactor analyseFile to analyzeFiles accepting multiple files
JanTvrdik 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 |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| [*] | ||
| charset = utf-8 | ||
| end_of_line = lf | ||
| trim_trailing_whitespace = true | ||
| insert_final_newline = true | ||
| indent_style = space | ||
| indent_size = 4 |
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,12 @@ | ||
| * text=auto | ||
|
|
||
| /cache export-ignore | ||
| /.editorconfig export-ignore | ||
| /.gitattributes export-ignore | ||
| /.github export-ignore | ||
| /.gitignore export-ignore | ||
| /temp-clone export-ignore | ||
| /composer-dependency-analyser.php export-ignore | ||
| /phpcs.xml.dist export-ignore | ||
| /phpstan.neon.dist export-ignore | ||
| /phpunit.xml.dist export-ignore | ||
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,28 @@ | ||
| name: Checks | ||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: | ||
| - "master" | ||
| - "v[0-9]" | ||
| jobs: | ||
| checks: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| steps: | ||
| - | ||
| name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| - | ||
| name: Setup PHP | ||
| uses: shivammathur/setup-php@v2 | ||
| with: | ||
| php-version: 8.4 | ||
JanTvrdik marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - | ||
| name: Install dependencies | ||
| run: composer install --no-progress --prefer-dist --no-interaction | ||
|
|
||
| - | ||
| name: Run checks | ||
| run: composer check | ||
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,26 @@ | ||
| name: phpcs.xml lint | ||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: | ||
| - "master" | ||
| - "v[0-9]" | ||
|
|
||
| jobs: | ||
| xml-linter: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - | ||
| name: Checkout code | ||
| uses: actions/checkout@v3 | ||
JanTvrdik marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| - | ||
| name: Install dependencies | ||
| run: composer install --no-progress --no-interaction | ||
|
|
||
| - | ||
| name: Lint | ||
| uses: ChristophWurst/xmllint-action@v1 | ||
| with: | ||
| xml-file: phpcs.xml.dist | ||
| xml-schema-file: vendor/squizlabs/php_codesniffer/phpcs.xsd | ||
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,5 @@ | ||
| /vendor | ||
| /cache/* | ||
| !/cache/.gitkeep | ||
| /.idea | ||
| /phpstan.neon |
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,21 @@ | ||
| MIT License | ||
|
|
||
| Copyright (c) 2025 Bedabox, LLC dba ShipMonk | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in all | ||
| copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| SOFTWARE. |
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.
Uh oh!
There was an error while loading. Please reload this page.