Ingo Schommer 2016-09-27 14:18:19 +13:00 committed by Sam Minnée
parent c2132af70f
commit ec66912bc0
7 changed files with 5383 additions and 9462 deletions

View File

@ -1,16 +0,0 @@
engines:
eslint:
enabled: true
scss-lint:
enabled: true
duplication:
enabled: true
config:
languages:
javascript:
mass_threshold: 100
ratings:
paths:
- client/src/**
exclude_paths:
- "client/dist/**"

178
.sass-lint.yml Normal file
View File

@ -0,0 +1,178 @@
# sass-lint config to match the AirBNB style guide
files:
include: 'client/src/**/*.scss'
ignore:
- 'client/src/styles/legacy/*'
- 'admin/client/src/styles/legacy/*'
options:
formatter: stylish
merge-default-rules: false
rules:
# Warnings
# Things that require actual refactoring are marked as warnings
class-name-format:
- 1
- convention: hyphenatedbem
placeholder-name-format:
- 1
- convention: hyphenatedlowercase
nesting-depth:
- 1
- max-depth: 3
no-ids: 1
no-important: 1
no-misspelled-properties:
- 1
- extra-properties:
- "-moz-border-radius-topleft"
- "-moz-border-radius-topright"
- "-moz-border-radius-bottomleft"
- "-moz-border-radius-bottomright"
variable-name-format:
- 1
- allow-leading-underscore: true
convention: hyphenatedlowercase
no-extends: 1
# Warnings: these things are preferential rather than mandatory
no-css-comments: 1
# Errors
# Things that can be easily fixed are marked as errors
indentation:
- 2
- size: 2
final-newline:
- 2
- include: true
no-trailing-whitespace: 2
border-zero:
- 2
- convention: '0'
brace-style:
- 2
- allow-single-line: true
clean-import-paths:
- 2
- filename-extension: false
leading-underscore: false
no-debug: 2
no-empty-rulesets: 2
no-invalid-hex: 2
no-mergeable-selectors: 2
# no-qualifying-elements:
# - 1
# - allow-element-with-attribute: false
# allow-element-with-class: false
# allow-element-with-id: false
no-trailing-zero: 2
no-url-protocols: 2
quotes:
- 2
- style: double
space-after-bang:
- 2
- include: false
space-after-colon:
- 2
- include: true
space-after-comma:
- 2
- include: true
space-before-bang:
- 2
- include: true
space-before-brace:
- 2
- include: true
space-before-colon: 2
space-between-parens:
- 2
- include: false
trailing-semicolon: 2
url-quotes: 2
zero-unit: 2
single-line-per-selector: 2
one-declaration-per-line: 2
empty-line-between-blocks:
- 2
- ignore-single-line-rulesets: true
# Missing rules
# There are no sass-lint rules for the following AirBNB style items, but thess
# - Put comments on their own line
# - Put property delcarations before mixins
# Disabled rules
# These are other rules that we may wish to consider using in the future
# They are not part of the AirBNB CSS standard but they would introduce some strictness
# bem-depth: 0
# variable-for-property: 0
# no-transition-all: 0
# hex-length:
# - 1
# - style: short
# hex-notation:
# - 1
# - style: lowercase
# property-units:
# - 1
# - global:
# - ch
# - em
# - ex
# - rem
# - cm
# - in
# - mm
# - pc
# - pt
# - px
# - q
# - vh
# - vw
# - vmin
# - vmax
# - deg
# - grad
# - rad
# - turn
# - ms
# - s
# - Hz
# - kHz
# - dpi
# - dpcm
# - dppx
# - '%'
# per-property: {}
# force-attribute-nesting: 1
# force-element-nesting: 1
# force-pseudo-nesting: 1
# function-name-format:
# - 1
# - allow-leading-underscore: true
# convention: hyphenatedlowercase
# no-color-literals: 1
# no-duplicate-properties: 1
# mixin-name-format:
# - 1
# - allow-leading-underscore: true
# convention: hyphenatedlowercase
# shorthand-values:
# - 1
# - allowed-shorthands:
# - 1
# - 2
# - 3
# leading-zero:
# - 1
# - include: false
# no-vendor-prefixes:
# - 1
# - additional-identifiers: []
# excluded-identifiers: []
# placeholder-in-extend: 1
# no-color-keywords: 2

View File

@ -1,60 +0,0 @@
# See https://docs.silverstripe.org/en/4.0/getting_started/css_coding_conventions/
# Install instructions: https://github.com/brigade/scss-lint
# Adapted from https://github.com/airbnb/css
# Used for CodeClimate CI checks.
scss_files: '**/client/src/**/*.scss'
exclude:
- 'client/src/styles/legacy/*'
severity: error
linters:
BorderZero:
enabled: true
convention: zero
BemDepth:
enabled: true
DeclarationOrder:
enabled: false
ExtendDirective:
enabled: true
LeadingZero:
enabled: false
NameFormat:
enabled: true
PrivateNamingConvention:
enabled: true
prefix: _
PropertySortOrder:
enabled: false
QualifyingElement:
enabled: false
SelectorFormat:
enabled: true
convention: hyphenated_BEM
class_convention: ^(?!js-).*
class_convention_explanation: should not be written in the form js-*
SingleLinePerProperty:
enabled: true
allow_single_line_rule_sets: false
StringQuotes:
enabled: true
style: double_quotes
UrlQuotes:
# TODO Re-enable once it support double quotes
enabled: false

View File

@ -12,6 +12,7 @@ addons:
env: env:
global: global:
- TRAVIS_NODE_VERSION="4"
- CORE_RELEASE=master - CORE_RELEASE=master
- ARTIFACTS_REGION=us-east-1 - ARTIFACTS_REGION=us-east-1
- ARTIFACTS_BUCKET=silverstripe-travis-artifacts - ARTIFACTS_BUCKET=silverstripe-travis-artifacts
@ -21,17 +22,19 @@ env:
matrix: matrix:
include: include:
- php: 5.5 - php: 5.5
env: DB=MYSQL env: DB=MYSQL PHPUNIT_TEST=1
- php: 5.5 - php: 5.5
env: DB=PGSQL env: DB=PGSQL PHPUNIT_TEST=1
- php: 5.5 - php: 5.5
env: DB=SQLITE env: DB=SQLITE PHPUNIT_TEST=1
- php: 5.6 - php: 5.6
env: DB=MYSQL PDO=1 env: DB=MYSQL PDO=1 PHPUNIT_TEST=1
- php: 5.6 - php: 5.6
env: DB=MYSQL BEHAT_TEST=1 env: DB=MYSQL BEHAT_TEST=1 PHPUNIT_TEST=1
- php: 5.6
env: NPM_TEST=1
- php: 7.0 - php: 7.0
env: DB=MYSQL PDO=1 env: DB=MYSQL PDO=1 PHPUNIT_TEST=1
before_script: before_script:
- composer self-update || true - composer self-update || true
@ -43,10 +46,12 @@ before_script:
- cd ~/builds/ss - cd ~/builds/ss
- php ~/travis-support/travis_setup_selenium.php --if-env BEHAT_TEST - php ~/travis-support/travis_setup_selenium.php --if-env BEHAT_TEST
- php ~/travis-support/travis_setup_php54_webserver.php --if-env BEHAT_TEST - php ~/travis-support/travis_setup_php54_webserver.php --if-env BEHAT_TEST
- "if [ \"$NPM_TEST\" = \"1\" ]; then (cd cms && nvm install $TRAVIS_NODE_VERSION && npm install --silent); fi"
script: script:
- "if [ \"$BEHAT_TEST\" = \"\" ]; then vendor/bin/phpunit cms/tests; fi" - "if [ \"PHPUNIT_TEST\" = \"1\" ]; then vendor/bin/phpunit cms/tests; fi"
- "if [ \"$BEHAT_TEST\" = \"1\" ]; then vendor/bin/behat @cms; fi" - "if [ \"$BEHAT_TEST\" = \"1\" ]; then vendor/bin/behat @cms; fi"
- "if [ \"$NPM_TEST\" = \"1\" ]; then (cd cms && nvm use 4 && npm run lint); fi"
after_failure: after_failure:
- php ~/travis-support/travis_upload_artifacts.php --if-env BEHAT_TEST,ARTIFACTS_BUCKET,ARTIFACTS_KEY,ARTIFACTS_SECRET --target-path $TRAVIS_REPO_SLUG/$TRAVIS_BUILD_ID/$TRAVIS_JOB_ID --artifacts-base-url https://s3.amazonaws.com/$ARTIFACTS_BUCKET/ - php ~/travis-support/travis_upload_artifacts.php --if-env BEHAT_TEST,ARTIFACTS_BUCKET,ARTIFACTS_KEY,ARTIFACTS_SECRET --target-path $TRAVIS_REPO_SLUG/$TRAVIS_BUILD_ID/$TRAVIS_JOB_ID --artifacts-base-url https://s3.amazonaws.com/$ARTIFACTS_BUCKET/

View File

@ -1,7 +1,6 @@
## SilverStripe CMS ## SilverStripe CMS
[![Build Status](https://secure.travis-ci.org/silverstripe/silverstripe-cms.png?branch=3.1)](http://travis-ci.org/silverstripe/silverstripe-cms) [![Build Status](https://secure.travis-ci.org/silverstripe/silverstripe-cms.png?branch=master)](http://travis-ci.org/silverstripe/silverstripe-cms)
[![Code Climate](https://codeclimate.com/github/silverstripe/silverstripe-cms/badges/gpa.svg)](https://codeclimate.com/github/silverstripe/silverstripe-cms)
![helpfulrobot](https://helpfulrobot.io/silverstripe/cms/badge) ![helpfulrobot](https://helpfulrobot.io/silverstripe/cms/badge)
PHP5 Content Management System (CMS), see [http://silverstripe.org](http://silverstripe.org). Requires the [`framework`](http://github.com/silverstripe/silverstripe-framework) module and a [`silverstripe-installer`](http://github.com/silverstripe/silverstripe-installer) base project. PHP5 Content Management System (CMS), see [http://silverstripe.org](http://silverstripe.org). Requires the [`framework`](http://github.com/silverstripe/silverstripe-framework) module and a [`silverstripe-installer`](http://github.com/silverstripe/silverstripe-installer) base project.

12592
npm-shrinkwrap.json generated

File diff suppressed because it is too large Load Diff

View File

@ -12,7 +12,7 @@
"build": "webpack", "build": "webpack",
"watch": "webpack -w", "watch": "webpack -w",
"lock": "npm-shrinkwrap --dev", "lock": "npm-shrinkwrap --dev",
"lint": "eslint javascript" "lint": "eslint client/src & sass-lint -v"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@ -47,6 +47,7 @@
"npm-shrinkwrap": "https://registry.npmjs.org/npm-shrinkwrap/-/npm-shrinkwrap-6.0.2.tgz", "npm-shrinkwrap": "https://registry.npmjs.org/npm-shrinkwrap/-/npm-shrinkwrap-6.0.2.tgz",
"postcss-loader": "^0.10.1", "postcss-loader": "^0.10.1",
"resolve-url-loader": "^1.6.0", "resolve-url-loader": "^1.6.0",
"sass-lint": "^1.9.1",
"sass-loader": "^4.0.0", "sass-loader": "^4.0.0",
"semver": "^5.1.0", "semver": "^5.1.0",
"url-loader": "^0.5.7", "url-loader": "^0.5.7",