Skip to content
This repository was archived by the owner on Sep 5, 2025. It is now read-only.

Conversation

@Ismail-elkorchi
Copy link
Contributor

@Ismail-elkorchi Ismail-elkorchi commented Mar 30, 2020

Changes proposed in this Pull Request:

This PR updates the linting tools used in Travis by :

  • Adding package.json file and specifying @wordpress/scripts as the only dependency.

  • Adding composer.json file and specifying Composer installer for PHP_CodeSniffer, WPThemeReview and PHP Parallel Lint as dependencies

  • Adding lint:scss command to package.json to lint scss files using the lint-style script which is defined in @wordpress/scripts

  • Adding lint:js command to package.json to lint js files using the lint-js script which is defined in @wordpress/scripts

  • Adding lint:wpcs command to composer.json to lint php files using php_codesniffer

  • Adding lint:php command to composer.json to lint php files for syntax errors

  • Adding .stylelintrc.json and .eslintrc configuration files for stylelint and eslint

  • Removing .jshintignore and .jscsrc files since @wordpress/scripts uses eslint under the hood

  • Updating .travis.yml to use newer versions of php, install the dependencies and run the commands defined in package.json and composer.json

  • Updating phpcs.xml.dist

With these changes Travis is now reporting many issues regarding the coding standards which must be fixed in #1388.

Related issue(s):

#1311, #1149, #1159, #1291

@Ismail-elkorchi Ismail-elkorchi changed the title Add composer.json and package.json for linting PHP, SCSS and JS files with Travis PHP, SCSS and JS linting tools for use in local and Travis Apr 6, 2020
@Ismail-elkorchi Ismail-elkorchi merged commit f5248e1 into Automattic:master Apr 7, 2020
@Ismail-elkorchi Ismail-elkorchi deleted the linting-travis branch April 7, 2020 22:19
"php-parallel-lint/php-parallel-lint": "^1.2.0"
},
"scripts": {
"lint:wpcs": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs --runtime-set testVersion 5.6-",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for testVersion runtime value here, when it's already in the PHPCS config file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GaryJones thank you. I'll remove it in a follow-up PR.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants