# This is an opinionated list of which hooks are valuable to run and what their
# out-of-the-box settings should be.
#-------------------------------------------------------------------------------

# Loads Bundler context from a Gemfile. If false, does nothing (default).
#
# Specifying a Gemfile for Bundler to load allows you to control which gems are
# available in the load path (i.e. loadable via `require`) within your hook
# runs. Note that having a Gemfile requires you to include `overcommit` itself
# in your Gemfile (otherwise Overcommit can't load itself!).
#
# This is useful if you want to:
#
#   - Enforce a specific version of Overcommit to use for all hook runs
#     (or to use a version from the master branch that has not been released yet)
#   - Enforce a specific version or unreleased branch is used for a gem you want
#     to use in your git hooks
#
# WARNING: This makes your hook runs slower, but you can work around this!
#
# Loading a Bundler context necessarily adds a startup delay to your hook runs
# as Bundler parses the Gemfile and checks that the dependencies are satisfied.
# Thus for projects with many gems this can introduce a noticeable delay.
#
# The recommended workaround is to create a separate Gemfile in the root of your
# repository (call it `.overcommit_gems.rb`), and include only the gems that
# your Overcommit hooks need in order to run. This significantly reduces the
# startup delay in your hook runs. Make sure to commit both
# `.overcommit_gems.rb` and the resulting `.overcommit_gems.rb.lock` file to
# your repository, and then set the `gemfile` option below to the name you gave
# the file.
# (Generate lock file by running `bundle install --gemfile=.overcommit_gems.rb`)
gemfile: false

# Where to store hook plugins specific to a repository. These are loaded in
# addition to the default hooks Overcommit comes with. The location is relative
# to the root of the repository.
plugin_directory: '.git-hooks'

# Whether to hide hook output by default. This results in completely silent hook
# runs except in the case of warning or failure.
quiet: false

# Number of hooks that can be run concurrently. Typically this won't need to be
# adjusted, but if you know that some of your hooks themselves use multiple
# processors you can lower this value accordingly. You can define
# single-operator mathematical expressions, e.g. '%{processors} * 2', or
# '%{processors} / 2'.
concurrency: '%{processors}'

# Whether to check if a hook plugin has changed since Overcommit last ran it.
# This is a defense mechanism when working with repositories which can contain
# untrusted code (e.g. when you fetch a pull request from a third party).
# See https://github.com/brigade/overcommit#security for more information.
verify_signatures: true

PreCommit:
  ALL:
    problem_on_unmodified_line: 'report'
    requires_files:             true
    required:                   false
    exclude:
      - 'bower_components/**/*'
      - 'node_modules/**/*'
      - 'vendor/**/*'

  AuthorEmail:
    enabled:                  true

  AuthorName:
    enabled:                  true

  BerksfileCheck:
    enabled:                  true

  Brakeman:
    enabled:                  false

  BrokenSymlinks:
    enabled:                  true

  BundleAudit:
    enabled:                  true
    include:
      - 'Gemfile'
      - 'Gemfile.lock'
      - '*.gemspec'

  BundleCheck:
    enabled:                  true
    include:
      - 'Gemfile'
      - 'Gemfile.lock'
      - '*.gemspec'

  BundleOutdated:
    enabled:                  true
    include:
      - 'Gemfile'
      - 'Gemfile.lock'
      - '*.gemspec'

  CaseConflicts:
    enabled:                  true

  ChamberSecurity:
    enabled:                  true

  CoffeeLint:
    enabled:                  true

  Credo:
    enabled:                  true
    include:
      - '**/*.ex'
      - '**/*.exs'

  CssLint:
    enabled:                  true

  Dogma:
    enabled:                  true

  EsLint:
    enabled:                  true

  ExecutePermissions:
    enabled:                  true
    exclude:
      - 'Rakefile'
      - 'bin/**/*'
      - 'scripts/**/*'

  Fasterer:
    enabled:                  false
    include:
      - '**/*.rb'

  FixMe:
    enabled:                  true
    keywords:
      - 'BROKEN'
      - 'BUG'
      - 'ERROR'
      - 'FIXME'
      - 'HACK'
      - 'NOTE'
      - 'OPTIMIZE'
      - 'REVIEW'
      - 'TODO'
      - 'WTF'
      - 'XXX'

  Foodcritic:
    enabled:                  false

  ForbiddenBranches:
    enabled:                  false

  GoLint:
    enabled:                  true

  GoVet:
    enabled:                  true

  Hlint:
    enabled:                  true

  HamlLint:
    enabled:                  false

  HardTabs:
    enabled:                  true
    exclude:
      - '**/*.svg'
      - '**/Info.plist'
      - '**/project.pbxproj'
      - '**/structure.sql'
      - '**/xcschememanagement.plist'

  HtmlHint:
    enabled:                  true

  HtmlTidy:
    enabled:                  false

  ImageOptim:
    enabled:                  false

  JavaCheckstyle:
    enabled:                  true

  Jscs:
    enabled:                  false

  JsHint:
    enabled:                  false

  JsLint:
    enabled:                  false

  Jsl:
    enabled:                  false

  JsonSyntax:
    enabled:                  true

  LicenseHeader:
    enabled:                  false
    licence_file:             'LICENSE.txt'

  LineEndings:
    enabled:                  true

  LocalPathsInGemfile:
    enabled:                  true

  Mdl:
    enabled:                  true
    include:
      - '**/*.md'

  MergeConflicts:
    enabled:                  true

  MessageFormat:
    enabled:                  true
    pattern:                  '(Add|Fix|Change|Remove|Deprecate|Security|Docs|Style|Tests|Chore|WIP):\s'
    expected_pattern_message: '<Change Type>: <Commit Message Description>'
    sample_message:           'Chore: Refactor onboarding flow'

  NginxTest:
    enabled:                  true

  Pep257:
    enabled:                  false

  Pep8:
    enabled:                  false

  PuppetLint:
    enabled:                  true

  Pyflakes:
    enabled:                  false

  Pylint:
    enabled:                  false

  PythonFlake8:
    enabled:                  false

  RailsBestPractices:
    enabled:                  false

  RailsSchemaUpToDate:
    enabled:                  true
    include:
      - '**/db/migrate/*.rb'
      - '**/db/schema.rb'
      - '**/db/structure.sql'

  Reek:
    enabled:                  false

  RuboCop:
    enabled:                  true

  RubyLint:
    enabled:                  false

  Scalariform:
    enabled:                  false

  Scalastyle:
    enabled:                  false

  ScssLint:
    enabled:                  true

  SemiStandard:
    enabled:                  false

  ShellCheck:
    enabled:                  true
    flags:
      - '--format=gcc'
      - '-e SC1090'
      - '-e SC1117'
      - '-e SC2148'
      - '-e SC2155'
      - '-e SC2181'
    include:
      - '**/*.sh'
      - '**/*.bash'
      - '**/*.zsh'
      - '**/bash_profile'
      - '**/bashrc'
      - '**/zshrc'

  SlimLint:
    enabled:                  false

  Sqlint:
    enabled:                  true

  Standard:
    enabled:                  false

  TrailingWhitespace:
    enabled:                  true
    exclude:                  '**/structure.sql'

  TravisLint:
    enabled:                  true

  TsLint:
    enabled:                  true
    include:
      - '**/*.ts'

  Vint:
    enabled:                  true

  W3cCss:
    enabled:                  false

  W3cHtml:
    enabled:                  false

  XmlLint:
    enabled:                  true

  XmlSyntax:
    enabled:                  true

  YamlLint:
    enabled:                  false
    include:
      - '**/*.yaml'
      - '**/*.yml'

  YamlSyntax:
    enabled:                  true

PrePush:
  ALL:
    requires_files:           false
    required:                 false

  Minitest:
    enabled:                  false

  ProtectedBranches:
    enabled:                  false

  RSpec:
    enabled:                  false

PreRebase:
  ALL:
    requires_files:           false
    required:                 false

  MergedCommits:
    enabled:                  false

CommitMsg:
  ALL:
    requires_files:           false

  CapitalizedSubject:
    enabled:                  true

  Commitplease:
    enabled:                  false

  EmptyMessage:
    enabled:                  false

  GerritChangeId:
    enabled:                  false

  HardTabs:
    enabled:                  true

  RussianNovel:
    enabled:                  false

  SingleLineSubject:
    enabled:                  true

  SpellCheck:
    enabled:                  false

  TextWidth:
    enabled:                  true
    max_subject_width:        72
    max_body_width:           80

  TrailingPeriod:
    enabled:                  true

PostCheckout:
  ALL:
    required:                 false
    skip_file_checkout:       true

  BowerInstall:
    enabled:                  false

  BundleCheck:
    enabled:                  true

  IndexTags:
    enabled:                  false

  NpmInstall:
    enabled:                  false

  SubmoduleStatus:
    enabled:                  false

PostCommit:
  ALL:
    requires_files:           false
    required:                 false

  BowerInstall:
    enabled:                  false

  BundleInstall:
    enabled:                  false

  GitGuilt:
    enabled:                  false

  IndexTags:
    enabled:                  false

  NpmInstall:
    enabled:                  false

  SubmoduleStatus:
    enabled:                  false

PostMerge:
  ALL:
    enabled:                  false
    requires_files:           false

  BowerInstall:
    enabled:                  false

  BundleInstall:
    enabled:                  false

  IndexTags:
    enabled:                  false

  NpmInstall:
    enabled:                  false

  SubmoduleStatus:
    enabled:                  false

PostRewrite:
  ALL:
    requires_files:           false

  BowerInstall:
    enabled:                  false

  BundleInstall:
    enabled:                  false

  IndexTags:
    enabled:                  false

  NpmInstall:
    enabled:                  false

  SubmoduleStatus:
    enabled:                  false
