Search code examples
phpcommand-line-interfacecode-climate

How to install phpcodesniffer engine to work with CodeClimate CLI?


I'm just trying to use codeclimate cli to analyze my code locally. I'm using Mac OS X 10.10.3 and, as recommended here, I'm using boot2docker.

Everything good so far. I run codeclimate init to generate .codeclimate.yml file and tweaked it. It looks like this:

---
engines:
  phpcodesniffer:
    enabled: true
  coffeelint:
    enabled: true
  eslint:
    enabled: true
  csslint:
    enabled: true
ratings:
  paths:
  - "**.php"
  - "**.coffee"
  - "**.js"
  - "**.jsx"
  - "**.css"
exclude_paths:
- node_modules/**/*
- vendor/**/*
- etc/**/*
- .vagrant/**/*

After that I run codeclimate engines:install and this is my output:

Pulling docker images.
WARNING: unknown engine name: phpcodesniffer
...

Finally, codeclimate engines:list outputs:

Available engines: - bundler-audit: Patch-level verification for Bundler - coffeelint: A style checker for CoffeeScript - csslint: Automated linting of Cascading Stylesheets - eslint: A JavaScript/JSX linting utility - gofmt: gofmt - golint: golint - govet: govet - rubocop: A Ruby static code analyzer, based on the community Ruby style guide. - rubymotion: Rubymotion-specific rubocop checks - watson: A young Ember Doctor to help you fix your code.

What am I doing wrong? How should I install this engine?

Many thanks in advance


Solution

  • We (Code Climate) just recently released the phpcodesniffer engine, and your local Code Climate CLI version likely needs to be updated to know about it.

    I just updated our docs to explain how to run an update: http://docs.codeclimate.com/article/301-code-climate-cli-troubleshooting#unknown_engine