-
Notifications
You must be signed in to change notification settings - Fork 86
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 PHPStan to verify code samples #2370
Merged
Merged
Changes from 20 commits
Commits
Show all changes
57 commits
Select commit
Hold shift + click to select a range
17a93db
Applied CI review suggestion
mnocon 1ee92a6
Added basic PHPStan config
mnocon 13aff01
Added PHPStan for ActivityLog examples
mnocon ff41a4d
Added CI
mnocon c87307d
[TMP] Added invalid code on purpose
mnocon 0783bfe
Fixed auth issues
mnocon a3f8521
Fixed CS job
mnocon 20bc7f5
PHP CS Fixes
mnocon 64d490d
Rerun
mnocon 4ea50f8
Simplified namespaces
mnocon dd974af
[TMP] Use the old namespace
mnocon 4f3e5bb
Generated baseline
mnocon cc1dbec
Reduced baseline
mnocon 8cfcd6a
Finished reviewing baseline
mnocon 51fb2e4
PHP CS Fixes
mnocon fb52915
Rerun
mnocon a39859e
Removed autoloading
mnocon 1aeab11
[TMP] Break
mnocon c306a61
Adjusted lines
mnocon 46bd6e5
Apply suggestions from code review
mnocon 43349f5
Added space separation
mnocon 35ef89b
Line offset fixes (#2430)
adriendupuis cc8a8b5
Added basic PHPStan config
mnocon 2d26319
Added PHPStan for ActivityLog examples
mnocon 8fe86b1
Added CI
mnocon 888bdc2
[TMP] Added invalid code on purpose
mnocon a6f5afe
Fixed auth issues
mnocon 55152a6
Fixed CS job
mnocon c56e277
PHP CS Fixes
mnocon 73a1450
Rerun
mnocon ee9c888
Simplified namespaces
mnocon aee693e
[TMP] Use the old namespace
mnocon 701d924
Generated baseline
mnocon 2e272b8
Reduced baseline
mnocon 73ec727
Finished reviewing baseline
mnocon ec31d2e
PHP CS Fixes
mnocon cb8b1e0
Rerun
mnocon 3b42e64
Removed autoloading
mnocon ac2cfbb
[TMP] Break
mnocon 2df97b6
Adjusted lines
mnocon ef77364
Applied CI review suggestion
mnocon e1e2d91
Apply suggestions from code review
mnocon 9688359
Added space separation
mnocon 8026320
Revert "[TMP] Break"
mnocon 66ea736
Bumped CS-Fixer version
mnocon 4880a27
Fixed CS
mnocon 9f7cc86
Removed redundant doc block from WebinarEventTitleFulltextFieldMapper
mnocon 0ae2840
Added readme mention
mnocon 8aefb6f
Added empty line to cart_api
mnocon 337219c
Removed CS-fixer dependencies
mnocon 182e548
Improved cart_api
mnocon bc4a920
Update code_samples/recent_activity/src/Command/MonitorRecentContentC…
mnocon eddb70f
Merge commit '35ef89be785c312f35db3d731840187a2bedda67' into add-phpstan
mnocon d210b1b
Merge remote-tracking branch 'origin/master' into add-phpstan
mnocon ae980b4
PHP CS Fixes
mnocon c8462ed
Removed TMP changes
mnocon ad3656d
Merge remote-tracking branch 'origin/add-phpstan' into add-phpstan
mnocon 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 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,62 +1,98 @@ | ||
name: 'Build & test documentation' | ||
name: "Build & test documentation" | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- '[0-9]+.[0-9]+' | ||
- "[0-9]+.[0-9]+" | ||
pull_request: ~ | ||
|
||
jobs: | ||
build: | ||
permissions: | ||
# Give the default GITHUB_TOKEN write permission to commit and push the | ||
# added or changed files to the repository. | ||
contents: write | ||
# Give the default GITHUB_TOKEN write permission to commit and push the | ||
# added or changed files to the repository. | ||
contents: write | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.8] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install php-cs-fixer | ||
run: composer require friendsofphp/php-cs-fixer --dev | ||
- name: Run PHP CS Fixer | ||
run: ./vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php -v --show-progress=dots | ||
- name: Commit changes | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
commit_message: PHP CS Fixes | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
- name: Run build | ||
run: | | ||
mkdocs build --strict | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- uses: "ramsey/composer-install@v3" | ||
with: | ||
working-directory: "tools/php-cs-fixer" | ||
dependency-versions: highest | ||
- name: Run PHP CS Fixer | ||
run: tools/php-cs-fixer/vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php -v --show-progress=dots | ||
- name: Commit changes | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
commit_message: PHP CS Fixes | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
- name: Run build | ||
run: | | ||
mkdocs build --strict | ||
|
||
vale-check: | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'pull_request' | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Get Vale.sh configs | ||
env: | ||
TOKEN: ${{ secrets.EZROBOT_PAT }} | ||
run: | | ||
curl -H "Authorization: token $TOKEN" -L https://github.com/ibexa/vale-styles/archive/refs/heads/main.zip -o vale.zip | ||
unzip vale.zip | ||
rm vale.zip | ||
mv vale-styles-main/* vale-styles-main/.vale.ini . | ||
- name: Run Vale.sh | ||
uses: errata-ai/vale-action@reviewdog | ||
with: | ||
- uses: actions/checkout@v4 | ||
- name: Get Vale.sh configs | ||
env: | ||
TOKEN: ${{ secrets.EZROBOT_PAT }} | ||
run: | | ||
curl -H "Authorization: token $TOKEN" -L https://github.com/ibexa/vale-styles/archive/refs/heads/main.zip -o vale.zip | ||
unzip vale.zip | ||
rm vale.zip | ||
mv vale-styles-main/* vale-styles-main/.vale.ini . | ||
- name: Run Vale.sh | ||
uses: errata-ai/vale-action@reviewdog | ||
with: | ||
reporter: github-check | ||
filter_mode: added | ||
|
||
code-samples: | ||
name: Validate code samples | ||
runs-on: "ubuntu-22.04" | ||
strategy: | ||
matrix: | ||
php: | ||
- "8.3" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup PHP Action | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
coverage: none | ||
extensions: "pdo_sqlite, gd" | ||
tools: cs2pr | ||
|
||
- name: Add composer keys for private packagist | ||
run: | | ||
composer config http-basic.updates.ibexa.co $SATIS_NETWORK_KEY $SATIS_NETWORK_TOKEN | ||
composer config github-oauth.github.com $TRAVIS_GITHUB_TOKEN | ||
env: | ||
SATIS_NETWORK_KEY: ${{ secrets.SATIS_NETWORK_KEY }} | ||
SATIS_NETWORK_TOKEN: ${{ secrets.SATIS_NETWORK_TOKEN }} | ||
TRAVIS_GITHUB_TOKEN: ${{ secrets.TRAVIS_GITHUB_TOKEN }} | ||
|
||
- uses: ramsey/composer-install@v3 | ||
with: | ||
dependency-versions: highest | ||
|
||
- name: Run PHPStan analysis | ||
run: composer phpstan |
This file contains 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 |
---|---|---|
|
@@ -5,3 +5,4 @@ __pycache__/* | |
**/.idea/ | ||
.php-cs-fixer.cache | ||
composer.lock | ||
tools/php-cs-fixer/vendor |
This file contains 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 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 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 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 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 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 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 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 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 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 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.
As a general rule of thumb, try to separate each step in jobs with one empty line. This makes it easier for version control to pick up which sections of the jobs changed.
This is true for all YAML files. We do the same for service declarations.
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.
Makes sense, thanks for the suggestion!