Skip to content
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

Overhaul the extension, release version 1.1.0 [SEL-1057] #7

Merged
merged 4 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions .eslintrc.json

This file was deleted.

1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text eol=lf
71 changes: 64 additions & 7 deletions .github/workflows/mediawiki.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,44 @@ on:
pull_request:
branches: [ "*" ]

env:
EXTNAME: PagePort

jobs:
style-php:
name: 'Code Style (PHP)'
runs-on: ubuntu-latest
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: mbstring, intl
coverage: none
tools: composer, phpcs, phplint

- uses: actions/checkout@v4

- name: Setup Composer
run: composer update
shell: bash

- name: Lint
run: phplint -w --exclude=vendor
shell: bash

- name: PHP Code Sniffer
run: vendor/bin/phpcs -sp --standard=.phpcs.xml .
shell: bash

test:
name: "PHPUnit: MW ${{ matrix.mw }}, PHP ${{ matrix.php }}"
strategy:
fail-fast: false
matrix:
include:
- mw: 'REL1_35'
- mw: 'REL1_39'
php: 7.4
# - mw: 'REL1_36'
# php: 7.4
# - mw: 'REL1_37'
# php: 7.4
# - mw: 'master'
# php: 7.4
runs-on: ubuntu-latest
steps:
# check out the repository!
Expand All @@ -36,3 +59,37 @@ jobs:
mwbranch: ${{ matrix.mw }}
extension: PagePort
testgroup: extension-PagePort

security:
name: Static Analysis
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [ '7.4', '8.1' ]
# Deliberately *not* testing against `master`
mediawiki: [ REL1_39 ]
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mbstring, intl, ast
coverage: none
tools: composer
- name: Setup MediaWiki
uses: actions/checkout@v3
with:
repository: wikimedia/mediawiki
ref: ${{ matrix.mediawiki }}
- name: Setup Extension
uses: actions/checkout@v3
with:
path: extensions/${{ env.EXTNAME }}
- name: Setup Composer
run: |
echo '{"extra":{"merge-plugin":{"include":["extensions/*/composer.json","skins/*/composer.json"]}}}' > composer.local.json
composer update
composer update
- name: Phan
run: ./vendor/bin/phan -d extensions/${{ env.EXTNAME }} --minimum-target-php-version=7.4 --long-progress-bar
6 changes: 0 additions & 6 deletions .gitreview

This file was deleted.

4 changes: 4 additions & 0 deletions .phan/config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php

// use phan config shipped with mediawiki core
return require __DIR__ . '/../../../vendor/mediawiki/mediawiki-phan-config/src/config.php';
2 changes: 2 additions & 0 deletions .phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
<ruleset>
<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki" />
<file>.</file>
<arg name="extensions" value="php"/>
<arg name="encoding" value="UTF-8"/>
</ruleset>
3 changes: 0 additions & 3 deletions .stylelintrc.json

This file was deleted.

29 changes: 0 additions & 29 deletions Gruntfile.js

This file was deleted.

14 changes: 0 additions & 14 deletions PagePort.i18n.alias.php

This file was deleted.

21 changes: 0 additions & 21 deletions PagePortHooks.php

This file was deleted.

9 changes: 8 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
"ext-zip": "*"
},
"require-dev": {
"mediawiki/mediawiki-codesniffer": "44.0.0 || 38.0.0",
"mediawiki/minus-x": "1.1.0",
"estahn/phpunit-json-assertions": "^3.0"
"php-parallel-lint/php-console-highlighter": "1.0.0 || 0.5",
"php-parallel-lint/php-parallel-lint": "1.3.2 || 1.3.1"
},
"scripts": {
"test": [
Expand All @@ -16,5 +18,10 @@
"minus-x fix .",
"phpcbf"
]
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
23 changes: 7 additions & 16 deletions extension.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,27 @@
{
"name": "PagePort",
"version": "1.0.0",
"version": "1.1.0",
"author": [
"WikiWorks team"
"WikiWorks team",
"Daniel Scherzer"
],
"url": "https://www.mediawiki.org/wiki/Extension:PagePort",
"descriptionmsg": "pageport-desc",
"license-name": "MIT",
"requires": {
"MediaWiki": ">= 1.30.0"
"MediaWiki": ">= 1.39.0"
},
"type": "other",
"AutoloadClasses": {
"PagePortHooks": "PagePortHooks.php",
"PagePort": "includes/PagePort.php"
},
"config": {},
"ExtensionMessagesFiles": {
"PagePortAlias": "PagePort.i18n.alias.php"
},
"Hooks": {
"UnitTestsList": "PagePortHooks::onUnitTestsList"
},
"MessagesDirs": {
"PagePort": [
"i18n"
]
},
"ResourceModules": {},
"ResourceFileModulePaths": {
"localBasePath": "",
"remoteExtPath": "PagePort"
},
"ServiceWiringFiles": [
"includes/ServiceWiring.php"
],
"manifest_version": 2
}
Loading
Loading