Skip to content

Commit

Permalink
codeclimate
Browse files Browse the repository at this point in the history
  • Loading branch information
smmccabe committed Jun 20, 2018
1 parent 76bccb1 commit d60d277
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 3 deletions.
13 changes: 13 additions & 0 deletions .codeclimate.yml
@@ -0,0 +1,13 @@
version: "2"
plugins:
phpcodesniffer:
enabled: true
config:
file_extensions: "php,module,inc,install,test,profile,theme,css,info,txt,md"
standard: "DrupalPractice"
file-list: ".phpcs-files"
phpmd:
enabled: true
config:
file-list: ".phpcs-files"
rulesets: "cleancode, codesize, controversial, design, naming, unusedcode"
26 changes: 23 additions & 3 deletions .gitlab-ci.yml
Expand Up @@ -20,10 +20,9 @@ code_standards:
script:
# runs the Drupal code standards checks on our custom code
# the Drupal Code Standards come from the Coder module, which is automatically part of the base testing image
- phpcs --standard=Drupal -n --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md web/modules/custom
- phpcs --standard=Drupal -n --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md web/themes/custom --ignore=*.css
- phpcs --standard=Drupal -n --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md --file-list=template.phpcs-files --ignore=*.css

code_quality:
mess_detector:
stage: test
script:
- phpmd web/modules/custom text cleancode || true
Expand All @@ -39,6 +38,27 @@ code_quality:
paths:
- code_quality

codequality:
# It won't make sense to run codequality on deploy branches, because we
# are assuming that the developer has already addressed the problems.
# except:
# - uat
# - master
image: docker:stable
stage: test
variables:
DOCKER_DRIVER: overlay2
allow_failure: true
services:
- docker:stable-dind
before_script:
- docker info
script:
- docker pull codeclimate/codeclimate
- docker run --env CODECLIMATE_CODE="$PWD" --volume "$PWD":/code --volume /var/run/docker.sock:/var/run/docker.sock --volume /tmp/cc:/tmp/cc codeclimate/codeclimate analyze -f json > codeclimate.json
artifacts:
paths: [codeclimate.json]

security_advisories:
stage: test
script:
Expand Down
2 changes: 2 additions & 0 deletions .phpcs-files
@@ -0,0 +1,2 @@
web/modules/custom
web/themes/custom

0 comments on commit d60d277

Please sign in to comment.