Add support for phplint

This commit is contained in:
Shivam Mathur 2020-06-24 04:30:50 +05:30
parent dd27d4eb81
commit 6158538131
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A
4 changed files with 11 additions and 4 deletions

View File

@ -148,7 +148,7 @@ with:
These tools can be setup globally using the `tools` input. These tools can be setup globally using the `tools` input.
`blackfire`, `blackfire-player`, `codeception`, `composer`, `composer-prefetcher`, `cs2pr`, `deployer`, `flex`, `infection`, `pecl`, `phan`, `phinx`, `phive`, `phpcbf`, `phpcpd`, `php-config`, `php-cs-fixer`, `phpcs`, `phpize`, `phpmd`, `phpstan`, `phpunit`, `prestissimo`, `psalm`, `symfony`, `vapor-cli` `blackfire`, `blackfire-player`, `codeception`, `composer`, `composer-prefetcher`, `cs2pr`, `deployer`, `flex`, `infection`, `pecl`, `phan`, `phinx`, `phive`, `php-config`, `php-cs-fixer`, `phpcbf`, `phpcpd`, `phpcs`, `phpize`, `phplint`, `phpmd`, `phpstan`, `phpunit`, `prestissimo`, `psalm`, `symfony`, `vapor-cli`
```yaml ```yaml
uses: shivammathur/setup-php@v2 uses: shivammathur/setup-php@v2

View File

@ -384,7 +384,7 @@ describe('Tools tests', () => {
it('checking addTools on linux', async () => { it('checking addTools on linux', async () => {
const script: string = await tools.addTools( const script: string = await tools.addTools(
'blackfire, blackfire-player, cs2pr, flex, php-cs-fixer, phpstan, phpunit, pecl, phinx, phinx:1.2.3, phive, php-config, phpize, symfony, wp-cli', 'blackfire, blackfire-player, cs2pr, flex, php-cs-fixer, phplint, phpstan, phpunit, pecl, phinx, phinx:1.2.3, phive, php-config, phpize, symfony, wp-cli',
'7.4', '7.4',
'linux' 'linux'
); );
@ -419,6 +419,7 @@ describe('Tools tests', () => {
expect(script).toContain('add_pecl'); expect(script).toContain('add_pecl');
expect(script).toContain('add_composertool flex flex symfony/'); expect(script).toContain('add_composertool flex flex symfony/');
expect(script).toContain('add_composertool phinx phinx robmorgan/'); expect(script).toContain('add_composertool phinx phinx robmorgan/');
expect(script).toContain('add_composertool phplint phplint overtrue/');
expect(script).toContain('add_composertool phinx phinx:1.2.3 robmorgan/'); expect(script).toContain('add_composertool phinx phinx:1.2.3 robmorgan/');
expect(script).toContain('add_devtools'); expect(script).toContain('add_devtools');
expect(script).toContain('add_log "$tick" "php-config" "Added"'); expect(script).toContain('add_log "$tick" "php-config" "Added"');

5
dist/index.js vendored
View File

@ -1918,7 +1918,7 @@ async function getCleanedToolsList(tools_csv) {
.map(function (extension) { .map(function (extension) {
return extension return extension
.trim() .trim()
.replace(/symfony\/|laravel\/|robmorgan\/|hirak\/|narrowspark\/automatic-/, ''); .replace(/hirak\/|laravel\/|narrowspark\/automatic-|overtrue\/|robmorgan\/|symfony\//, '');
}) })
.filter(Boolean); .filter(Boolean);
return [...new Set(tools_list)]; return [...new Set(tools_list)];
@ -2062,6 +2062,9 @@ async function addTools(tools_csv, php_version, os_version) {
case 'phinx': case 'phinx':
script += await addPackage(tool, release, 'robmorgan/', os_version); script += await addPackage(tool, release, 'robmorgan/', os_version);
break; break;
case 'phplint':
script += await addPackage(tool, release, 'overtrue/', os_version);
break;
case 'prestissimo': case 'prestissimo':
script += await addPackage(tool, release, 'hirak/', os_version); script += await addPackage(tool, release, 'hirak/', os_version);
break; break;

View File

@ -358,7 +358,7 @@ export async function getCleanedToolsList(
return extension return extension
.trim() .trim()
.replace( .replace(
/symfony\/|laravel\/|robmorgan\/|hirak\/|narrowspark\/automatic-/, /hirak\/|laravel\/|narrowspark\/automatic-|overtrue\/|robmorgan\/|symfony\//,
'' ''
); );
}) })
@ -539,6 +539,9 @@ export async function addTools(
case 'phinx': case 'phinx':
script += await addPackage(tool, release, 'robmorgan/', os_version); script += await addPackage(tool, release, 'robmorgan/', os_version);
break; break;
case 'phplint':
script += await addPackage(tool, release, 'overtrue/', os_version);
break;
case 'prestissimo': case 'prestissimo':
script += await addPackage(tool, release, 'hirak/', os_version); script += await addPackage(tool, release, 'hirak/', os_version);
break; break;