From 1e3bf5c213d14b4eae36e49b9bc785d7f5058086 Mon Sep 17 00:00:00 2001 From: Remco Tolsma <869674+remcotolsma@users.noreply.github.com> Date: Mon, 30 Oct 2023 10:24:40 +0100 Subject: [PATCH] Remove Grunt. --- .gitignore | 3 ++ .phplint.yml | 9 +++++ Gruntfile.js | 93 -------------------------------------------------- composer.json | 3 +- package.json | 11 +----- phpcs.xml.dist | 8 +++++ 6 files changed, 23 insertions(+), 104 deletions(-) create mode 100644 .phplint.yml delete mode 100644 Gruntfile.js diff --git a/.gitignore b/.gitignore index 56d1a91..645615c 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,6 @@ # PHPUnit /.phpunit.cache/ /.phpunit.result.cache + +# PHPLint +/.phplint.cache/ diff --git a/.phplint.yml b/.phplint.yml new file mode 100644 index 0000000..29e8e9c --- /dev/null +++ b/.phplint.yml @@ -0,0 +1,9 @@ +path: ./ +jobs: 10 +extensions: + - php +exclude: + - node_modules/ + - vendor/ + - vendor-bin/ + - wordpress/ diff --git a/Gruntfile.js b/Gruntfile.js deleted file mode 100644 index bc66c4f..0000000 --- a/Gruntfile.js +++ /dev/null @@ -1,93 +0,0 @@ -/* jshint node:true */ -module.exports = function( grunt ) { - require( 'load-grunt-tasks' )( grunt ); - - // Project configuration. - grunt.initConfig( { - pkg: grunt.file.readJSON( 'package.json' ), - - // PHPLint - phplint: { - core: [ - 'src/**/*.php' - ] - }, - - // PHP Code Sniffer - phpcs: { - core: { - src: [ - 'src/**/*.php' - ] - }, - options: { - bin: 'vendor/bin/phpcs', - standard: 'phpcs.xml.dist', - showSniffCodes: true - } - }, - - // PHPUnit - phpunit: { - options: { - bin: 'vendor/bin/phpunit' - }, - classes: { - - } - }, - - // Check text domain errors - checktextdomain: { - options:{ - text_domain: 'pronamic-datetime', - keywords: [ - '__:1,2d', - '_e:1,2d', - '_x:1,2c,3d', - 'esc_html__:1,2d', - 'esc_html_e:1,2d', - 'esc_html_x:1,2c,3d', - 'esc_attr__:1,2d', - 'esc_attr_e:1,2d', - 'esc_attr_x:1,2c,3d', - '_ex:1,2c,3d', - '_n:1,2,4d', - '_nx:1,2,4c,5d', - '_n_noop:1,2,3d', - '_nx_noop:1,2,3c,4d' - ] - }, - files: { - src: [ - 'src/**/*.php' - ], - expand: true - } - }, - - // Make POT - makepot: { - target: { - options: { - domainPath: 'languages', - type: 'wp-plugin', - mainFile: 'pronamic-money.php', - updatePoFiles: true, - updateTimestamp: false, - exclude: [ - 'vendor/.*', - 'wordpress/.*' - ], - include: [ - 'src/.*' - ] - } - } - } - } ); - - // Default task(s). - grunt.registerTask( 'default', [ 'phplint', 'phpcs', 'phpunit' ] ); - grunt.registerTask( 'pot', [ 'checktextdomain', 'makepot' ] ); -}; diff --git a/composer.json b/composer.json index 6638006..9ca4ab9 100644 --- a/composer.json +++ b/composer.json @@ -34,6 +34,7 @@ "koodimonni-language/fr_fr": "*", "koodimonni-language/ja": "*", "koodimonni-language/nl_nl": "*", + "overtrue/phplint": "^9.0", "php-coveralls/php-coveralls": "^2.4", "php-stubs/wordpress-globals": "^0.2.0", "phpmd/phpmd": "^2.9", @@ -50,7 +51,7 @@ "coveralls": "vendor/bin/php-coveralls -v", "phpcbf": "XDEBUG_MODE=off vendor/bin/phpcbf", "phpcs": "XDEBUG_MODE=off vendor/bin/phpcs -s -v", - "phplint": "find src tests -name '*.php' | xargs -n 1 -P 4 php -l", + "phplint": "vendor/bin/phplint", "phpmd": "vendor/bin/phpmd src,tests text phpmd.ruleset.xml --suffixes php", "phpstan": "vendor/bin/phpstan analyse --memory-limit=-1", "phpunit": "vendor/bin/phpunit", diff --git a/package.json b/package.json index ca3d7b3..5fd3c2c 100644 --- a/package.json +++ b/package.json @@ -17,14 +17,5 @@ "bugs": { "url": "https://github.com/pronamic/wp-datetime/issues" }, - "homepage": "https://github.com/pronamic/wp-datetime#readme", - "devDependencies": { - "grunt": "^1.0.4", - "grunt-checktextdomain": "^1.0.1", - "grunt-phpcs": "^0.4.0", - "grunt-phplint": "0.1.0", - "grunt-phpunit": "^0.3.6", - "grunt-wp-i18n": "^1.0.3", - "load-grunt-tasks": "^5.1.0" - } + "homepage": "https://github.com/pronamic/wp-datetime#readme" } diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 21e8970..f469027 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -9,4 +9,12 @@ + + + + + + + +