Hound Documentation

Want to modify style rules to better suit your preferences? Below you will find documentation on configuring style rules for each linter that we support.

If this page doesn't help you find what you are looking for, please tweet at us @houndci or email us at hound@thoughtbot.com and we will help you out.

Hound Configuration

All supported linters, except the ones in beta, are enabled by default.

Hound will look for a custom configuration file named .hound.yml in the root directory of your project.

Using .hound.yml you can tell Hound which linters to enable or disable, specify paths to files that provide custom style rules, and determine which files/directories to ignore. Here is an example:

scss: enabled: false ruby: config_file: .rubocop.yml jshint: ignore_file: .jshintignore

In this example, review of SCSS is deactivated, custom RuboCop configuration is provided for Ruby files, and an ignore file is given that tells which files/directories JSHint should not review.

Hound can be configured to use GitHub's Status API to mark a pull request as failed if any violations are found. To do so, add the following to your .hound.yml

fail_on_violations: true

Ruby

Hound uses RuboCop to review Ruby code.

By default, Hound uses the default RuboCop config. To change the way RuboCop is configured, add a .rubocop.yml file to your project, configure it as desired (see the RuboCop docs), and reference it in .hound.yml ruby: config_file: .rubocop.yml

To disable Ruby style checking, add the following to your .hound.yml ruby: enabled: false

CoffeeScript

Hound uses CoffeeLint with the default configuration.

To change the way CoffeeLint is configured, add a config file to your project and reference it in your .hound.yml coffeescript: config_file: coffeelint.json

To disable CoffeeScript style checking, add the following to your .hound.yml coffeescript: enabled: false

JavaScript

Hound uses JSHint with this config by default.

To change the way JSHint is configured, copy the default config file into your project, make changes and reference the file in your .hound.yml

jshint: config_file: .jshintrc

To ignore certain files and directories, add .jshintignore file to your project, include in it path patterns for files/directories that you want ignored, and reference the ignore file in your .hound.yml . See linter docs for more info ("Ignoring Files" section). jshint: ignore_file: .javascript_ignore

To disable JavaScript style checking, add the following to your .hound.yml jshint: enabled: false

ESLint (beta)

Hound uses ESLint with this config by default.

To enable ESLint style checking, add the following to your .hound.yml eslint: enabled: true

To change the way ESLint is configured, add .eslintrc file to your project, specify your desired configuration and reference the file in your .hound.yml

eslint: enabled: true config_file: .eslintrc

For more information on configuring ESLint rules, see the ESLint Rules Documentation

To ignore certain files and directories, add .eslintignore file to your project, include in it path patterns for files/directories that you want ignored, and reference the ignore file in your .hound.yml . See linter docs for more info. eslint: ignore_file: .eslintignore

SCSS

Hound uses scss-lint with this config by default.

To change the way scss-lint is configured, simply copy the default config file into your project, make changes and reference the file in your .hound.yml

scss: config_file: .scss-lint.yml

To ignore certain SCSS files, add exclude: directive to your .scss-lint.yml file, like: exclude: - "app/assets/stylesheets/plugins/**"

To disable SCSS style checking, add the following to your .hound.yml scss: enabled: false

Haml

Hound uses haml-lint with this config by default.

To change the way haml-lint is configured, simply copy the default config file into your project, make changes and reference the file in your .hound.yml

haml: config_file: .haml-lint.yml

To disable Haml style checking, add the following to your .hound.yml haml: enabled: false

Go

To disable Go style checking, add the following to your .hound.yml go: enabled: false

Python (beta)

Hound uses Flake8 with this default config by default.

To enable Python style checking, add the following to your .hound.yml python: enabled: true

To change the way Flake8 is configured, create a .ini file with your custom configuration and reference the file in .hound.yml

python: enabled: true config_file: .flake8.ini

Swift

Hound uses SwiftLint with this config by default.

To change the way SwiftLint is configured, copy the default config file into your project, make changes and reference the file in your .hound.yml

swift: config_file: .swiftlint.yml

To disable Swift style checking, add the following to your .hound.yml file. swift: enabled: false

For more information on the available configuration in your config_file , you can read about it on the SwiftLint Configuration Documentation