From 19c540f98d65d114e8d43fa2e45f621983c62d3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Max=20Str=C3=BCbing?= Date: Wed, 6 Sep 2017 07:47:52 +0200 Subject: [PATCH] TASK: Add editorconfig linter --- Build/Jenkins/release-neos-ui.sh | 4 ++-- Build/Jenkins/update-neos-ui-compiled.sh | 10 +++++----- Build/TravisCi/Scripts/CodeStyle.sh | 2 +- .../Domain/Service/StateRenderingService.php | 2 +- .../StyleAndJavascriptInclusionService.php | 2 +- .../Neos/Ui/Fusion/Helper/ModulesHelper.php | 2 +- .../ChangeCollectionConverter.php | 2 +- package.json | 6 ++++-- packages/build-essentials/package.json | 5 ++++- .../neos-ui-backend-connector/package.json | 1 + .../neos-ui-ckeditor-bindings/package.json | 1 + packages/neos-ui-containers/package.json | 1 + .../neos-ui-contentrepository/package.json | 1 + packages/neos-ui-decorators/package.json | 1 + packages/neos-ui-editors/package.json | 1 + packages/neos-ui-extensibility/package.json | 1 + packages/neos-ui-guest-frame/package.json | 1 + packages/neos-ui-i18n/package.json | 1 + packages/neos-ui-inspector/package.json | 1 + packages/neos-ui-redux-store/package.json | 1 + packages/neos-ui-validators/package.json | 1 + packages/neos-ui-views/package.json | 1 + packages/neos-ui/package.json | 1 + packages/react-proptypes/package.json | 1 + packages/react-ui-components/README.md | 10 +++++----- packages/react-ui-components/package.json | 1 + .../react-ui-components/src/Dialog/style.css | 2 +- packages/utils-helpers/package.json | 1 + packages/utils-logger/package.json | 1 + packages/utils-redux/package.json | 1 + yarn.lock | 19 +++++++++++++++++++ 31 files changed, 64 insertions(+), 21 deletions(-) diff --git a/Build/Jenkins/release-neos-ui.sh b/Build/Jenkins/release-neos-ui.sh index 229f9e32af..c2df662a49 100755 --- a/Build/Jenkins/release-neos-ui.sh +++ b/Build/Jenkins/release-neos-ui.sh @@ -24,8 +24,8 @@ cd $DIR/../../ # download JQ if we don't have it yet, for manipulating composer.json if [ ! -f "jq-linux64" ]; then - wget https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64 - chmod +x jq-linux64 + wget https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64 + chmod +x jq-linux64 fi diff --git a/Build/Jenkins/update-neos-ui-compiled.sh b/Build/Jenkins/update-neos-ui-compiled.sh index 24aa88201b..ee892f36eb 100755 --- a/Build/Jenkins/update-neos-ui-compiled.sh +++ b/Build/Jenkins/update-neos-ui-compiled.sh @@ -34,12 +34,12 @@ git add Resources/Public/ git commit -m "Compile Neos UI - $GIT_SHA1" || true if [ "$GIT_BRANCH" == "origin/master" ]; then - echo "Git branch $GIT_BRANCH found, pushing to this branch." - git push origin HEAD:${GIT_BRANCH#*/} + echo "Git branch $GIT_BRANCH found, pushing to this branch." + git push origin HEAD:${GIT_BRANCH#*/} fi if [ "$GIT_TAG" != "" ]; then - echo "Git tag $GIT_TAG found; also tagging the UI-compiled package." - git tag -a -m "$GIT_TAG" $GIT_TAG - git push origin $GIT_TAG + echo "Git tag $GIT_TAG found; also tagging the UI-compiled package." + git tag -a -m "$GIT_TAG" $GIT_TAG + git push origin $GIT_TAG fi diff --git a/Build/TravisCi/Scripts/CodeStyle.sh b/Build/TravisCi/Scripts/CodeStyle.sh index 7cc0763583..10ead47920 100644 --- a/Build/TravisCi/Scripts/CodeStyle.sh +++ b/Build/TravisCi/Scripts/CodeStyle.sh @@ -11,4 +11,4 @@ set -e # This file serves as the script for the TravisCI `CodeStyle` TEST_SUITE environment. # The script will be executed in the package working directory. # -yarn lint +yarn lint && yarn lint:editorconfig diff --git a/Classes/Neos/Neos/Ui/Domain/Service/StateRenderingService.php b/Classes/Neos/Neos/Ui/Domain/Service/StateRenderingService.php index 8fc7930dec..fbc0fc0109 100644 --- a/Classes/Neos/Neos/Ui/Domain/Service/StateRenderingService.php +++ b/Classes/Neos/Neos/Ui/Domain/Service/StateRenderingService.php @@ -43,4 +43,4 @@ protected function computeStateInternally(&$adjustedState, $context) } } } -} \ No newline at end of file +} diff --git a/Classes/Neos/Neos/Ui/Domain/Service/StyleAndJavascriptInclusionService.php b/Classes/Neos/Neos/Ui/Domain/Service/StyleAndJavascriptInclusionService.php index 4af2a5c2e7..f4ccce094e 100644 --- a/Classes/Neos/Neos/Ui/Domain/Service/StyleAndJavascriptInclusionService.php +++ b/Classes/Neos/Neos/Ui/Domain/Service/StyleAndJavascriptInclusionService.php @@ -80,4 +80,4 @@ protected function build(array $resourceArrayToSort, \Closure $builderForLine) return $result; } -} \ No newline at end of file +} diff --git a/Classes/Neos/Neos/Ui/Fusion/Helper/ModulesHelper.php b/Classes/Neos/Neos/Ui/Fusion/Helper/ModulesHelper.php index 7e3edcb859..435dd14f63 100644 --- a/Classes/Neos/Neos/Ui/Fusion/Helper/ModulesHelper.php +++ b/Classes/Neos/Neos/Ui/Fusion/Helper/ModulesHelper.php @@ -38,7 +38,7 @@ public function isEnabled($modulePath) if (isset($moduleConfiguration['enabled']) && $moduleConfiguration['enabled'] !== true) { return false; } - + array_pop($modulePathSegments); if ($modulePathSegments === []) { diff --git a/Classes/Neos/Neos/Ui/TypeConverter/ChangeCollectionConverter.php b/Classes/Neos/Neos/Ui/TypeConverter/ChangeCollectionConverter.php index a3a463a2aa..1d4517afb5 100644 --- a/Classes/Neos/Neos/Ui/TypeConverter/ChangeCollectionConverter.php +++ b/Classes/Neos/Neos/Ui/TypeConverter/ChangeCollectionConverter.php @@ -131,7 +131,7 @@ protected function convertChangeData($changeData) if (!isset($this->typeMap[$type])) { return new \Neos\Error\Messages\Error( - sprintf('Could not convert change type %s, it is unknown to the system', $type)); + sprintf('Could not convert change type %s, it is unknown to the system', $type)); } $changeClass = $this->typeMap[$type]; diff --git a/package.json b/package.json index 3a1f2df930..37ecc062d2 100644 --- a/package.json +++ b/package.json @@ -14,13 +14,14 @@ "coverage:publish": "lerna run coverage:publish --concurrency 1", "test": "lerna run test --concurrency 1", "test:e2e": "yarn run testcafe chrome:headless Tests/IntegrationTests/*", - "lint": "lerna run lint --concurrency 1" + "lint": "lerna run lint --concurrency 1", + "lint:editorconfig": "editorconfig-checker --exclude 'packages\/|Resources\/|LICENSE|README' && lerna run lint:editorconfig --concurrency 1" }, "devDependencies": { - "@neos-project/build-essentials": "*", "@inkdpixels/commit-analyzer": "^1.0.0", "@inkdpixels/release-notes-generator": "^1.0.0", "@neos-project/brand": "^1.1.0", + "@neos-project/build-essentials": "*", "@neos-project/eslint-config-neos": "^1.1.1", "babel-cli": "^6.8.0", "babel-core": "^6.13.2", @@ -39,6 +40,7 @@ "cpx": "^1.3.1", "cross-env": "^3.0.0", "css-loader": "^0.28.4", + "editorconfig-checker": "^1.0.2", "enzyme": "^2.8.2", "eslint": "^3.1.1", "extract-text-webpack-plugin": "^1.0.1", diff --git a/packages/build-essentials/package.json b/packages/build-essentials/package.json index 47fc63e15a..8ccd77d091 100644 --- a/packages/build-essentials/package.json +++ b/packages/build-essentials/package.json @@ -10,6 +10,7 @@ "cpx": "./node_modules/.bin/cpx", "codeclimate-test-reporter": "./node_modules/.bin/codeclimate-test-reporter", "cross-env": "./node_modules/.bin/cross-env", + "editorconfig-checker": "./node_modules/.bin/editorconfig-checker", "eslint": "./node_modules/.bin/eslint", "greenkeeper-postpublish": "./node_modules/.bin/greenkeeper-postpublish", "jest": "./node_modules/.bin/jest", @@ -19,7 +20,8 @@ "stylelint": "./node_modules/.bin/stylelint" }, "scripts": { - "lint": "eslint src" + "lint": "eslint src", + "lint:editorconfig": "editorconfig-checker" }, "dependencies": { "@neos-project/brand": "^1.1.0", @@ -38,6 +40,7 @@ "codeclimate-test-reporter": "^0.4.0", "cpx": "^1.3.1", "cross-env": "^3.0.0", + "editorconfig-checker": "^1.0.2", "eslint": "^3.1.1", "extract-text-webpack-plugin": "^1.0.1", "greenkeeper-postpublish": "^1.0.0", diff --git a/packages/neos-ui-backend-connector/package.json b/packages/neos-ui-backend-connector/package.json index 83d92304ce..5a7545a37e 100644 --- a/packages/neos-ui-backend-connector/package.json +++ b/packages/neos-ui-backend-connector/package.json @@ -12,6 +12,7 @@ "build:watch": "exit 0", "clean": "rimraf ./lib ./dist", "lint": "eslint src", + "lint:editorconfig": "editorconfig-checker", "jest": "PWD=$(pwd) NODE_ENV=test jest -w 1 --coverage" }, "devDependencies": { diff --git a/packages/neos-ui-ckeditor-bindings/package.json b/packages/neos-ui-ckeditor-bindings/package.json index fd3e973d17..6b3fe01f14 100644 --- a/packages/neos-ui-ckeditor-bindings/package.json +++ b/packages/neos-ui-ckeditor-bindings/package.json @@ -12,6 +12,7 @@ "build:watch": "yarn build -- --watch", "clean": "rimraf ./lib ./dist", "lint": "eslint src", + "lint:editorconfig": "editorconfig-checker", "jest": "PWD=$(pwd) NODE_ENV=test jest -w 1 --coverage" }, "devDependencies": { diff --git a/packages/neos-ui-containers/package.json b/packages/neos-ui-containers/package.json index 092ffe4e7c..f8e58e604e 100644 --- a/packages/neos-ui-containers/package.json +++ b/packages/neos-ui-containers/package.json @@ -11,6 +11,7 @@ "build": "exit 0", "build:watch": "exit 0", "lint": "eslint src", + "lint:editorconfig": "editorconfig-checker", "jest": "PWD=$(pwd) NODE_ENV=test jest -w 1 --coverage" }, "devDependencies": { diff --git a/packages/neos-ui-contentrepository/package.json b/packages/neos-ui-contentrepository/package.json index 83e63adbf8..1f4ddfa79c 100644 --- a/packages/neos-ui-contentrepository/package.json +++ b/packages/neos-ui-contentrepository/package.json @@ -12,6 +12,7 @@ "build:watch": "exit 0", "clean": "rimraf ./lib ./dist", "lint": "eslint src", + "lint:editorconfig": "editorconfig-checker", "jest": "PWD=$(pwd) NODE_ENV=test jest -w 1 --coverage" }, "devDependencies": { diff --git a/packages/neos-ui-decorators/package.json b/packages/neos-ui-decorators/package.json index 7fd2d3e99d..db36d0930a 100644 --- a/packages/neos-ui-decorators/package.json +++ b/packages/neos-ui-decorators/package.json @@ -12,6 +12,7 @@ "build:watch": "exit 0", "clean": "rimraf ./lib ./dist", "lint": "eslint src", + "lint:editorconfig": "editorconfig-checker", "jest": "PWD=$(pwd) NODE_ENV=test jest -w 1 --coverage" }, "devDependencies": { diff --git a/packages/neos-ui-editors/package.json b/packages/neos-ui-editors/package.json index 539aeb61c9..4200a68387 100644 --- a/packages/neos-ui-editors/package.json +++ b/packages/neos-ui-editors/package.json @@ -13,6 +13,7 @@ "build:watch": "yarn build -- --watch", "clean": "rimraf ./lib ./dist", "lint": "eslint src && stylelint 'src/**/*.css'", + "lint:editorconfig": "editorconfig-checker", "jest": "PWD=$(pwd) NODE_ENV=test jest -w 1 --coverage", "postpublish": "greenkeeper-postpublish" }, diff --git a/packages/neos-ui-extensibility/package.json b/packages/neos-ui-extensibility/package.json index 67779b1fd5..d24d298e00 100644 --- a/packages/neos-ui-extensibility/package.json +++ b/packages/neos-ui-extensibility/package.json @@ -11,6 +11,7 @@ "build:watch": "exit 0", "clean": "rimraf ./lib ./dist", "lint": "eslint src", + "lint:editorconfig": "editorconfig-checker", "jest": "PWD=$(pwd) NODE_ENV=test jest -w 1 --coverage" }, "dependencies": { diff --git a/packages/neos-ui-guest-frame/package.json b/packages/neos-ui-guest-frame/package.json index eefd0d53a8..b046c95425 100644 --- a/packages/neos-ui-guest-frame/package.json +++ b/packages/neos-ui-guest-frame/package.json @@ -12,6 +12,7 @@ "build:watch": "npm run build -- --watch", "clean": "rimraf ./lib ./dist", "lint": "eslint src", + "lint:editorconfig": "editorconfig-checker", "jest": "PWD=$(pwd) NODE_ENV=test jest -w 1 --coverage" }, "devDependencies": { diff --git a/packages/neos-ui-i18n/package.json b/packages/neos-ui-i18n/package.json index 8f7c6d1a63..0e6432172c 100644 --- a/packages/neos-ui-i18n/package.json +++ b/packages/neos-ui-i18n/package.json @@ -12,6 +12,7 @@ "build:watch": "exit 0", "clean": "rimraf ./lib ./dist", "lint": "eslint src", + "lint:editorconfig": "editorconfig-checker", "jest": "PWD=$(pwd) NODE_ENV=test jest -w 1 --coverage" }, "devDependencies": { diff --git a/packages/neos-ui-inspector/package.json b/packages/neos-ui-inspector/package.json index 7928df6ba4..e986cca7ee 100644 --- a/packages/neos-ui-inspector/package.json +++ b/packages/neos-ui-inspector/package.json @@ -12,6 +12,7 @@ "build:watch": "exit 0", "clean": "rimraf ./lib ./dist", "lint": "eslint src", + "lint:editorconfig": "editorconfig-checker", "jest": "PWD=$(pwd) NODE_ENV=test jest -w 1 --coverage" }, "devDependencies": { diff --git a/packages/neos-ui-redux-store/package.json b/packages/neos-ui-redux-store/package.json index 625c9f3ff4..9e790f05aa 100644 --- a/packages/neos-ui-redux-store/package.json +++ b/packages/neos-ui-redux-store/package.json @@ -12,6 +12,7 @@ "build:watch": "exit 0", "clean": "rimraf ./lib ./dist", "lint": "eslint src", + "lint:editorconfig": "editorconfig-checker", "jest": "PWD=$(pwd) NODE_ENV=test jest -w 1 --coverage" }, "devDependencies": { diff --git a/packages/neos-ui-validators/package.json b/packages/neos-ui-validators/package.json index 6f7cd7a3ae..956e2eac27 100644 --- a/packages/neos-ui-validators/package.json +++ b/packages/neos-ui-validators/package.json @@ -9,6 +9,7 @@ "test": "yarn jest", "test:watch": "yarn jest -- --watch", "lint": "eslint src", + "lint:editorconfig": "editorconfig-checker", "clean": "rimraf ./lib ./dist", "jest": "PWD=$(pwd) NODE_ENV=test jest -w 1 --coverage" }, diff --git a/packages/neos-ui-views/package.json b/packages/neos-ui-views/package.json index 671d689685..ca1dc26b0a 100644 --- a/packages/neos-ui-views/package.json +++ b/packages/neos-ui-views/package.json @@ -11,6 +11,7 @@ "test:watch": "yarn jest -- --watch", "clean": "rimraf ./lib ./dist", "lint": "eslint src && stylelint 'src/**/*.css'", + "lint:editorconfig": "editorconfig-checker", "jest": "PWD=$(pwd) NODE_ENV=test jest -w 1 --coverage", "postpublish": "greenkeeper-postpublish" }, diff --git a/packages/neos-ui/package.json b/packages/neos-ui/package.json index e1d0185361..c3f30ceb7e 100644 --- a/packages/neos-ui/package.json +++ b/packages/neos-ui/package.json @@ -12,6 +12,7 @@ "build:watch": "yarn build -- --watch", "clean": "rimraf ./lib ./dist", "lint": "eslint src && stylelint 'src/**/*.css'", + "lint:editorconfig": "editorconfig-checker", "jest": "PWD=$(pwd) NODE_ENV=test jest -w 1 --coverage" }, "devDependencies": { diff --git a/packages/react-proptypes/package.json b/packages/react-proptypes/package.json index 863a7ce1e4..d86a425195 100644 --- a/packages/react-proptypes/package.json +++ b/packages/react-proptypes/package.json @@ -12,6 +12,7 @@ "build:watch": "exit 0", "clean": "rimraf ./lib ./dist", "lint": "eslint src", + "lint:editorconfig": "editorconfig-checker", "jest": "PWD=$(pwd) NODE_ENV=test jest -w 1 --coverage" }, "devDependencies": { diff --git a/packages/react-ui-components/README.md b/packages/react-ui-components/README.md index 6eb7db3695..c0107f571a 100644 --- a/packages/react-ui-components/README.md +++ b/packages/react-ui-components/README.md @@ -64,9 +64,9 @@ After the installation succeeded, execute `yarn start` to start the Make a symbolic link inside your Neos installation to your cloned sources od this package. The following example assumes that both installations are in the same folder. ``` - cd YourNeosUiInstanz/Packages/Application/Neos.Neos.Ui/node_modules/@neos-project - rm -rf react-ui-components - ln -s ./../../../../../../react-ui-components/ . +cd YourNeosUiInstanz/Packages/Application/Neos.Neos.Ui/node_modules/@neos-project +rm -rf react-ui-components +ln -s ./../../../../../../react-ui-components/ . ``` @@ -80,8 +80,8 @@ yarn watch:build run the watcher inside the Neos.Neos.Ui Package ``` - cd YourNeosUiInstanz/Packages/Application/Neos.Neos.Ui - yarn watch:build +cd YourNeosUiInstanz/Packages/Application/Neos.Neos.Ui +yarn watch:build ``` #### Commit Guidelines diff --git a/packages/react-ui-components/package.json b/packages/react-ui-components/package.json index dfd5ded1f8..d230fbd0b3 100644 --- a/packages/react-ui-components/package.json +++ b/packages/react-ui-components/package.json @@ -13,6 +13,7 @@ "css": "cpx './src/**/*.css' ./lib && cpx './src/**/*.woff' ./lib && cpx './src/**/*.woff2' ./lib", "clean": "rimraf ./lib ./dist", "lint": "eslint src && stylelint 'src/**/*.css'", + "lint:editorconfig": "editorconfig-checker --exclude 'LICENSE|\/fontAwesome\/'", "jest": "jest src/**/*.spec.js -w 1 --coverage", "start": "cross-env STORY=true start-storybook -p 9001", "postpublish": "greenkeeper-postpublish", diff --git a/packages/react-ui-components/src/Dialog/style.css b/packages/react-ui-components/src/Dialog/style.css index c284e08464..9ad36a86ba 100644 --- a/packages/react-ui-components/src/Dialog/style.css +++ b/packages/react-ui-components/src/Dialog/style.css @@ -24,7 +24,7 @@ border: 1px solid var(--brandColorsContrastDark); .dialog--wide & { - max-width: calc(var(--goldenUnit) * 24); + max-width: calc(var(--goldenUnit) * 24); } } .dialog__title { diff --git a/packages/utils-helpers/package.json b/packages/utils-helpers/package.json index 209613ff61..92e6f56dda 100644 --- a/packages/utils-helpers/package.json +++ b/packages/utils-helpers/package.json @@ -12,6 +12,7 @@ "build:watch": "exit 0", "clean": "rimraf ./lib ./dist", "lint": "eslint src", + "lint:editorconfig": "editorconfig-checker", "jest": "PWD=$(pwd) NODE_ENV=test jest -w 1 --coverage" }, "devDependencies": { diff --git a/packages/utils-logger/package.json b/packages/utils-logger/package.json index 5058b33b1e..f2261f01cf 100644 --- a/packages/utils-logger/package.json +++ b/packages/utils-logger/package.json @@ -12,6 +12,7 @@ "build:watch": "exit 0", "clean": "rimraf ./lib ./dist", "lint": "eslint src", + "lint:editorconfig": "editorconfig-checker", "jest": "PWD=$(pwd) NODE_ENV=test jest -w 1 --coverage" }, "devDependencies": { diff --git a/packages/utils-redux/package.json b/packages/utils-redux/package.json index 70a5f4bd93..627f0a2be9 100644 --- a/packages/utils-redux/package.json +++ b/packages/utils-redux/package.json @@ -12,6 +12,7 @@ "build:watch": "exit 0", "clean": "rimraf ./lib ./dist", "lint": "eslint src", + "lint:editorconfig": "editorconfig-checker", "jest": "PWD=$(pwd) NODE_ENV=test jest -w 1 --coverage" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index c818f158d6..0bdaea6a13 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2659,6 +2659,15 @@ ecc-jsbn@~0.1.1: dependencies: jsbn "~0.1.0" +editorconfig-checker@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/editorconfig-checker/-/editorconfig-checker-1.0.2.tgz#a1a0d0dd1f6e4d51fd27f485d73549b89c54b8b1" + dependencies: + iniparser "^1.0.5" + minimatch "^3.0.4" + minimist "^1.2.0" + node-find-files "^0.0.4" + ee-first@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" @@ -3942,6 +3951,10 @@ ini@^1.2.0, ini@^1.3.2, ini@^1.3.4, ini@~1.3.0: version "1.3.4" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.4.tgz#0537cb79daf59b59a1a517dff706c86ec039162e" +iniparser@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/iniparser/-/iniparser-1.0.5.tgz#836d6befe6dfbfcee0bccf1cf9f2acc7027f783d" + inquirer@^0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-0.12.0.tgz#1ef2bfd63504df0bc75785fff8c2c41df12f077e" @@ -5467,6 +5480,12 @@ node-fetch@^1.0.1: encoding "^0.1.11" is-stream "^1.0.1" +node-find-files@^0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/node-find-files/-/node-find-files-0.0.4.tgz#e4b62c7f83a992627260d56f072115c618a87059" + dependencies: + async "0.2.6" + node-int64@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b"