Hound Introduces Style Guides for Organizations

Rob Whittaker

Hound checks style on GitHub pull requests for 138 projects at our company on a daily basis. We also have a style guide for the whole company. If we want to enforce a style across all our projects we have to copy and paste the same guide into each of our projects. That is a lot of copying, pasting, and maintenance. If, like me, you are a lazy programmer, you will soon get bored of this. We added a new feature to Hound that allows you to set the same style guide for a whole organization. With the flip of a switch, all your projects will enforce the same style guide.

How to enable

Sign into Hound and you will see a shiny new toggle switch next to your organization name. Flip the switch and you will be able to set a repository for Hound to pull its base configuration from.

Once enabled, Hound will look in the specified GitHub repository for a .hound.yml file. Hound will then use this configuration for all the repositories in the organization. Our configuration can be found in our guides repository.

But, don’t worry, you can merge in customisations on a per-project basis.

Hound will merge any styles found in a project with those in the organization guide. These configurations will then take precedent over the organization’s.

For example, your organization might have a Hound configuration similar to the following.

# .hound.yml
ruby:
  enabled: true
  config_file: .rubocop.yml

# .rubocopy.yml
Style/AccessorMethodName:
  Enabled: false

Style/Alias:
  Enabled: false

If you wanted to have different settings for one of your projects, you might have something like this.

# .hound.yml
ruby:
  enabled: true
  config_file: .rubocop.yml

# .rubocop.yml
Style/Alias:
  Enabled: true

This would give you the following combined configuration.

Style/AccessorMethodName:
  Enabled: false

Style/Alias:
  Enabled: true

As always Hound is an open-source project and we are always keen for contributions. Come join us!

For now, why don’t you get started and give organization-level style guides a whirl?