-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* (doc) Fix typo in comment * (tests) Run phpcs/phan via GitHub Actions * (1.43) Replace deprecated wfGetDB() * (1.43) Replace removed method User::getGroups() * (1.43) Replace nonexistent method ParserOutput::getRootText() * (1.43) Replace deprecated WikiPage::factory() * (1.43) Fix phan warning caused by incorrect type annotation * (1.43) Fix "undeclared class LinksUpdate" (class was renamed) * (phan) Fix "unused parameter" warnings * (1.43) Replace deprecated ContentHandler::getContentText() * (1.43) Replace deprecated ParserOutput::getText() * (1.43) Replace deprecated Status::getHTML() --------- Co-authored-by: Edward Chernenko <[email protected]>
- Loading branch information
1 parent
632ee15
commit 0934e6b
Showing
5 changed files
with
105 additions
and
26 deletions.
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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: JSON linter + luacheck | ||
|
||
on: [push, pull_request, workflow_dispatch] | ||
|
||
env: | ||
DBTYPE: mysql | ||
DBUSER: root | ||
|
||
jobs: | ||
# PHP linters: phpcs, parallel-lint, etc. | ||
linter: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '8.1' | ||
tools: composer | ||
- uses: actions/cache@v4 | ||
with: | ||
path: ~/.composer/cache | ||
key: buildcache-linter | ||
- run: sudo apt-get install -y composer && composer install | ||
- run: composer test | ||
|
||
# Phan (PHP static analyzer) | ||
phan: | ||
runs-on: ubuntu-22.04 | ||
env: | ||
branch: REL1_43 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '8.1' | ||
extensions: ast | ||
tools: composer | ||
- uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.composer/cache | ||
buildcache | ||
key: buildcache-phan | ||
- uses: edwardspec/github-action-build-mediawiki@v1 | ||
with: | ||
branch: ${{ env.branch }} | ||
noinstall: 1 | ||
- name: Install dependencies | ||
run: | | ||
rsync -a --exclude buildcache --exclude mediawiki --exclude .git . mediawiki/extensions/AccessControl/ | ||
cd mediawiki/extensions/AccessControl | ||
composer install | ||
- name: RUN -- phan | ||
run: cd mediawiki/extensions/AccessControl && ./vendor/bin/phan --analyze-twice |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
$cfg = require __DIR__ . '/../vendor/mediawiki/mediawiki-phan-config/src/config.php'; | ||
|
||
# Detect unused method parameters, etc. | ||
$cfg['unused_variable_detection'] = true; | ||
|
||
if ( getenv( 'PHAN_CHECK_DEPRECATED' ) ) { | ||
# Optional: warn about the use of @deprecated methods, etc. | ||
# Not enabled by default (without PHAN_CHECK_DEPRECATED=1) for backward compatibility. | ||
$cfg['suppress_issue_types'] = array_filter( $cfg['suppress_issue_types'], static function ( $issue ) { | ||
return strpos( $issue, 'PhanDeprecated' ) === false; | ||
} ); | ||
} | ||
|
||
return $cfg; |
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