repo stringlengths 5 92 | file_url stringlengths 80 287 | file_path stringlengths 5 197 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:37:27 2026-01-04 17:58:21 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook/pre_commit/puppet_metadata_json_lint_spec.rb | spec/overcommit/hook/pre_commit/puppet_metadata_json_lint_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PreCommit::PuppetMetadataJsonLint do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
before do
subject.stub(:applicab... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook/pre_commit/trailing_whitespace_spec.rb | spec/overcommit/hook/pre_commit/trailing_whitespace_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PreCommit::TrailingWhitespace do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
let(:staged_file) { 'filename.txt' }
b... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook/pre_commit/python_flake8_spec.rb | spec/overcommit/hook/pre_commit/python_flake8_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PreCommit::PythonFlake8 do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
before do
subject.stub(:applicable_files).... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook/pre_commit/local_paths_in_gemfile_spec.rb | spec/overcommit/hook/pre_commit/local_paths_in_gemfile_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PreCommit::LocalPathsInGemfile do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
let(:staged_file) { 'Gemfile' }
subject { described_class.new(config, ... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook/pre_commit/flay_spec.rb | spec/overcommit/hook/pre_commit/flay_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PreCommit::Flay do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
let(:applicable_files) { %w[file1.rb] }
subject { described_class.new(config, context) }
before do
... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook/pre_commit/xml_lint_spec.rb | spec/overcommit/hook/pre_commit/xml_lint_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PreCommit::XmlLint do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
before do
subject.stub(:applicable_files).and_r... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook/pre_commit/author_name_spec.rb | spec/overcommit/hook/pre_commit/author_name_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PreCommit::AuthorName do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
let(:result) { double('result') }
shared_exampl... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook/pre_commit/yaml_lint_spec.rb | spec/overcommit/hook/pre_commit/yaml_lint_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PreCommit::YamlLint do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
let(:applicable_files) { %w[file1.yaml file2.yml] }
subject { described_class.new(config, context) }... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook/pre_commit/yarn_check_spec.rb | spec/overcommit/hook/pre_commit/yarn_check_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PreCommit::YarnCheck do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
context 'when yarn.lock is ignored' do
around... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook/pre_commit/yard_coverage_spec.rb | spec/overcommit/hook/pre_commit/yard_coverage_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PreCommit::YardCoverage do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
before do
subject.stub(:applicable_files).... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook/pre_commit/pydocstyle_spec.rb | spec/overcommit/hook/pre_commit/pydocstyle_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PreCommit::Pydocstyle do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
before do
subject.stub(:applicable_files).an... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook/pre_commit/license_header_spec.rb | spec/overcommit/hook/pre_commit/license_header_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PreCommit::LicenseHeader do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
around do |example|
repo do
example... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook/pre_commit/bundle_outdated_spec.rb | spec/overcommit/hook/pre_commit/bundle_outdated_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PreCommit::BundleOutdated do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
context 'when Gemfile.lock is ignored' do
... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook/pre_commit/stylelint_spec.rb | spec/overcommit/hook/pre_commit/stylelint_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PreCommit::Stylelint do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
before do
subject.stub(:applicable_files).and... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook/pre_commit/java_checkstyle_spec.rb | spec/overcommit/hook/pre_commit/java_checkstyle_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PreCommit::JavaCheckstyle do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
before do
subject.stub(:applicable_files... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook/pre_commit/standard_spec.rb | spec/overcommit/hook/pre_commit/standard_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PreCommit::Standard do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
before do
subject.stub(:applicable_files).and_... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook/pre_commit/rubo_cop_spec.rb | spec/overcommit/hook/pre_commit/rubo_cop_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PreCommit::RuboCop do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
before do
subject.stub(:applicable_files).and_r... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook/pre_commit/semi_standard_spec.rb | spec/overcommit/hook/pre_commit/semi_standard_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PreCommit::SemiStandard do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
before do
subject.stub(:applicable_files).... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook/pre_commit/cook_style_spec.rb | spec/overcommit/hook/pre_commit/cook_style_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PreCommit::CookStyle do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
before do
subject.stub(:applicable_files).and... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook/pre_commit/vint_spec.rb | spec/overcommit/hook/pre_commit/vint_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PreCommit::Vint do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
let(:result) { double('result') }
before do
sub... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook/pre_commit/puppet_lint_spec.rb | spec/overcommit/hook/pre_commit/puppet_lint_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PreCommit::PuppetLint do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
before do
subject.stub(:applicable_files).an... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook/pre_commit/scalastyle_spec.rb | spec/overcommit/hook/pre_commit/scalastyle_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PreCommit::Scalastyle do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
before do
subject.stub(:applicable_files).an... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook/pre_commit/phpcs_spec.rb | spec/overcommit/hook/pre_commit/phpcs_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PreCommit::PhpCs do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
before do
subject.stub(:applicable_files).and_ret... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook/pre_commit/reek_spec.rb | spec/overcommit/hook/pre_commit/reek_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PreCommit::Reek do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
before do
subject.stub(:applicable_files).and_retu... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook/pre_commit/php_stan_spec.rb | spec/overcommit/hook/pre_commit/php_stan_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PreCommit::PhpStan do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
before do
subject.stub(:applicable_files).and_r... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook/pre_commit/dogma_spec.rb | spec/overcommit/hook/pre_commit/dogma_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PreCommit::Dogma do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
before do
subject.stub(:applicable_files).and_ret... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook/pre_commit/broken_symlinks_spec.rb | spec/overcommit/hook/pre_commit/broken_symlinks_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PreCommit::BrokenSymlinks do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
let(:staged_file) { 'staged-file.txt' }
subject { described_class.new(config, context) }
be... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook/pre_commit/pycodestyle_spec.rb | spec/overcommit/hook/pre_commit/pycodestyle_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PreCommit::Pycodestyle do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
before do
subject.stub(:applicable_files).a... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook/pre_commit/jsl_spec.rb | spec/overcommit/hook/pre_commit/jsl_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PreCommit::Jsl do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
before do
subject.stub(:applicable_files).and_retur... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook/pre_commit/pep257_spec.rb | spec/overcommit/hook/pre_commit/pep257_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PreCommit::Pep257 do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
before do
subject.stub(:applicable_files).and_re... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook/pre_commit/pep8_spec.rb | spec/overcommit/hook/pre_commit/pep8_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PreCommit::Pep8 do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
before do
subject.stub(:applicable_files).and_retu... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook/pre_commit/pyflakes_spec.rb | spec/overcommit/hook/pre_commit/pyflakes_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PreCommit::Pyflakes do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
before do
subject.stub(:applicable_files).and_... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook/pre_commit/hard_tabs_spec.rb | spec/overcommit/hook/pre_commit/hard_tabs_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PreCommit::HardTabs do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
let(:staged_file) { 'filename.txt' }
before do
... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook/pre_commit/haml_lint_spec.rb | spec/overcommit/hook/pre_commit/haml_lint_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PreCommit::HamlLint do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
before do
subject.stub(:applicable_files).and_... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook/pre_commit/php_lint_spec.rb | spec/overcommit/hook/pre_commit/php_lint_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PreCommit::PhpLint do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
before do
subject.stub(:applicable_files).and_r... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook/pre_commit/scalariform_spec.rb | spec/overcommit/hook/pre_commit/scalariform_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PreCommit::Scalariform do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
before do
subject.stub(:applicable_files).a... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook/pre_rebase/merged_commits_spec.rb | spec/overcommit/hook/pre_rebase/merged_commits_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PreRebase::MergedCommits do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
let(:master_branch) { 'master' }
before do... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook/post_checkout/yarn_install_spec.rb | spec/overcommit/hook/post_checkout/yarn_install_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PostCheckout::YarnInstall do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
let(:result) { double('result') }
before ... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook/post_checkout/index_tags_spec.rb | spec/overcommit/hook/post_checkout/index_tags_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PostCheckout::IndexTags do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
before do
subject.stub(:execute_in_backgro... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook/post_checkout/bundle_install_spec.rb | spec/overcommit/hook/post_checkout/bundle_install_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PostCheckout::BundleInstall do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
let(:result) { double('result') }
befor... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook/post_checkout/composer_install_spec.rb | spec/overcommit/hook/post_checkout/composer_install_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PostCheckout::ComposerInstall do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
let(:result) { double('result') }
bef... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook/post_checkout/bower_install_spec.rb | spec/overcommit/hook/post_checkout/bower_install_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PostCheckout::BowerInstall do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
let(:result) { double('result') }
before... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook/post_checkout/submodule_status_spec.rb | spec/overcommit/hook/post_checkout/submodule_status_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PostCheckout::SubmoduleStatus do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
let(:submodule_status) { double('submodu... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook/post_checkout/base_spec.rb | spec/overcommit/hook/post_checkout/base_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PostCheckout::Base do
let(:config) { double('config') }
let(:context) { double('context') }
let(:hook) { described_class.new(config, context) }
let(:hook_config) { {} }
before do
config.stub(:for_hook).and_return(hook_confi... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook/post_checkout/npm_install_spec.rb | spec/overcommit/hook/post_checkout/npm_install_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PostCheckout::NpmInstall do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
let(:result) { double('result') }
before d... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook_context/post_commit_spec.rb | spec/overcommit/hook_context/post_commit_spec.rb | # frozen_string_literal: true
require 'spec_helper'
require 'overcommit/hook_context/post_commit'
describe Overcommit::HookContext::PostCommit do
let(:config) { double('config') }
let(:args) { [] }
let(:input) { double('input') }
let(:context) { described_class.new(config, args, input) }
describe '#modifie... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook_context/prepare_commit_msg_spec.rb | spec/overcommit/hook_context/prepare_commit_msg_spec.rb | # frozen_string_literal: true
require 'spec_helper'
require 'overcommit/hook_context/prepare_commit_msg'
describe Overcommit::HookContext::PrepareCommitMsg do
let(:config) { double('config') }
let(:args) { [commit_message_filename, commit_message_source] }
let(:commit_message_filename) { 'message-template.txt' ... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook_context/run_all_spec.rb | spec/overcommit/hook_context/run_all_spec.rb | # frozen_string_literal: true
require 'spec_helper'
require 'overcommit/hook_context/run_all'
describe Overcommit::HookContext::RunAll do
let(:config) { double('config') }
let(:args) { [] }
let(:input) { double('input') }
let(:context) { described_class.new(config, args, input) }
describe '#modified_files'... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook_context/diff_spec.rb | spec/overcommit/hook_context/diff_spec.rb | # frozen_string_literal: true
require 'spec_helper'
require 'overcommit/hook_context/diff'
describe Overcommit::HookContext::Diff do
let(:config) { double('config') }
let(:args) { [] }
let(:input) { double('input') }
let(:context) { described_class.new(config, args, input, diff: 'master') }
describe '#modi... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook_context/pre_push_spec.rb | spec/overcommit/hook_context/pre_push_spec.rb | # frozen_string_literal: true
require 'spec_helper'
require 'overcommit/hook_context/pre_push'
describe Overcommit::HookContext::PrePush do
let(:config) { double('config') }
let(:args) { [remote_name, remote_url] }
let(:input) { double('input') }
let(:remote_name) { 'origin' }
let(:remote_url) { 'git@github... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook_context/commit_msg_spec.rb | spec/overcommit/hook_context/commit_msg_spec.rb | # frozen_string_literal: true
require 'spec_helper'
require 'overcommit/hook_context/commit_msg'
describe Overcommit::HookContext::CommitMsg do
let(:comment_char) { '#' }
let(:config) { double('config') }
let(:args) { [commit_message_file] }
let(:input) { double('input') }
let(:context) { described_class.ne... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook_context/post_merge_spec.rb | spec/overcommit/hook_context/post_merge_spec.rb | # frozen_string_literal: true
require 'spec_helper'
require 'overcommit/hook_context/post_merge'
describe Overcommit::HookContext::PostMerge do
let(:config) { double('config') }
let(:args) { [] }
let(:input) { double('input') }
let(:context) { described_class.new(config, args, input) }
describe '#squash?' ... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook_context/base_spec.rb | spec/overcommit/hook_context/base_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::HookContext::Base do
let(:config) { double('config') }
let(:args) { [] }
let(:input) { double('input') }
let(:context) { described_class.new(config, args, input) }
describe '#hook_class_name' do
subject { context.hook_class_name }... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook_context/pre_commit_spec.rb | spec/overcommit/hook_context/pre_commit_spec.rb | # frozen_string_literal: true
require 'spec_helper'
require 'overcommit/hook_context/pre_commit'
describe Overcommit::HookContext::PreCommit do
let(:config) { double('config') }
let(:args) { [] }
let(:input) { double('input') }
let(:context) { described_class.new(config, args, input) }
describe '#amendment... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook_context/pre_rebase_spec.rb | spec/overcommit/hook_context/pre_rebase_spec.rb | # frozen_string_literal: true
require 'spec_helper'
require 'overcommit/hook_context/pre_rebase'
describe Overcommit::HookContext::PreRebase do
let(:config) { double('config') }
let(:args) { [upstream_branch, rebased_branch] }
let(:upstream_branch) { 'master' }
let(:rebased_branch) { 'topic' }
let(:input) {... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook_context/post_checkout_spec.rb | spec/overcommit/hook_context/post_checkout_spec.rb | # frozen_string_literal: true
require 'spec_helper'
require 'overcommit/hook_context/post_checkout'
describe Overcommit::HookContext::PostCheckout do
let(:config) { double('config') }
let(:args) { [previous_head, new_head, branch_flag] }
let(:input) { double('input') }
let(:previous_head) { random_hash }
le... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/spec/overcommit/hook_context/post_rewrite_spec.rb | spec/overcommit/hook_context/post_rewrite_spec.rb | # frozen_string_literal: true
require 'spec_helper'
require 'overcommit/hook_context/post_rewrite'
describe Overcommit::HookContext::PostRewrite do
let(:config) { double('config') }
let(:input) { double('input') }
let(:context) { described_class.new(config, args, input) }
describe '#amend?' do
subject { ... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/lib/overcommit.rb | lib/overcommit.rb | # frozen_string_literal: true
require 'overcommit/os'
require 'overcommit/constants'
require 'overcommit/exceptions'
require 'overcommit/utils/file_utils'
require 'overcommit/utils'
require 'overcommit/git_version'
require 'overcommit/configuration_validator'
require 'overcommit/configuration'
require 'overcommit/conf... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/lib/overcommit/configuration_validator.rb | lib/overcommit/configuration_validator.rb | # frozen_string_literal: true
# rubocop:disable Metrics/ClassLength, Metrics/CyclomaticComplexity, Metrics/MethodLength
module Overcommit
# Validates and normalizes a configuration.
class ConfigurationValidator
# Validates hash for any invalid options, normalizing where possible.
#
# @param config [Ove... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/lib/overcommit/version.rb | lib/overcommit/version.rb | # frozen_string_literal: true
# Defines the gem version.
module Overcommit
VERSION = '0.68.0'
end
| ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/lib/overcommit/exceptions.rb | lib/overcommit/exceptions.rb | # frozen_string_literal: true
module Overcommit::Exceptions
# Base error class.
class Error < StandardError; end
# Raised when a {Configuration} could not be loaded from a file.
class ConfigurationError < Error; end
# Raised when the Overcommit configuration file signature has changed.
class Configuratio... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/lib/overcommit/logger.rb | lib/overcommit/logger.rb | # frozen_string_literal: true
module Overcommit
# Encapsulates all communication to an output source.
class Logger
# Helper for creating a logger which outputs nothing.
def self.silent
new(File.open(File::NULL, 'w'))
end
# Creates a logger that will write to the given output stream.
#
... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/lib/overcommit/message_processor.rb | lib/overcommit/message_processor.rb | # frozen_string_literal: true
module Overcommit
# Utility class that encapsulates the handling of hook messages and whether
# they affect lines the user has modified or not.
#
# This class exposes an endpoint that extracts an appropriate hook/status
# output tuple from an array of {Overcommit::Hook::Message}... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/lib/overcommit/utils.rb | lib/overcommit/utils.rb | # frozen_string_literal: true
require 'pathname'
require 'overcommit/os'
require 'overcommit/subprocess'
require 'overcommit/command_splitter'
require 'tempfile'
module Overcommit
# Utility functions for general use.
module Utils
# Helper class for doing quick constraint validations on version numbers.
#
... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/lib/overcommit/git_repo.rb | lib/overcommit/git_repo.rb | # frozen_string_literal: true
require 'iniparse'
require 'shellwords'
module Overcommit
# Provide a set of utilities for certain interactions with `git`.
module GitRepo
module_function
# Regular expression used to extract diff ranges from hunks of diff output.
DIFF_HUNK_REGEX = /
^@@\s
[^... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/lib/overcommit/os.rb | lib/overcommit/os.rb | # frozen_string_literal: true
require 'rbconfig'
module Overcommit
# Methods relating to the current operating system
module OS
class << self
def windows?
!(/mswin|msys|mingw|bccwin|wince|emc/ =~ host_os).nil?
end
def cygwin?
!(/cygwin/ =~ host_os).nil?
end
def ... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/lib/overcommit/subprocess.rb | lib/overcommit/subprocess.rb | # frozen_string_literal: true
require 'childprocess'
require 'tempfile'
require 'overcommit/os'
module Overcommit
# Manages execution of a child process, collecting the exit status and
# standard out/error output.
class Subprocess
# Encapsulates the result of a process.
#
# @attr_reader status [Inte... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/lib/overcommit/constants.rb | lib/overcommit/constants.rb | # frozen_string_literal: true
# Global application constants.
module Overcommit
HOME = File.expand_path(File.join(File.dirname(__FILE__), '..', '..')).freeze
CONFIG_FILE_NAME = '.overcommit.yml'
LOCAL_CONFIG_FILE_NAME = '.local-overcommit.yml'
HOOK_DIRECTORY = File.join(HOME, 'lib', 'overcommit', 'hook').free... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/lib/overcommit/hook_signer.rb | lib/overcommit/hook_signer.rb | # frozen_string_literal: true
module Overcommit
# Calculates, stores, and retrieves stored signatures of hook plugins.
class HookSigner
attr_reader :hook_name
# We don't want to include the skip setting as it is set by Overcommit
# itself
IGNORED_CONFIG_KEYS = %w[skip].freeze
# @param hook_na... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/lib/overcommit/configuration.rb | lib/overcommit/configuration.rb | # frozen_string_literal: true
require 'digest'
require 'json'
module Overcommit
# Stores configuration for Overcommit and the hooks it runs.
class Configuration # rubocop:disable Metrics/ClassLength
# Creates a configuration from the given hash.
#
# @param hash [Hash] loaded YAML config file as a hash... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/lib/overcommit/installer.rb | lib/overcommit/installer.rb | # frozen_string_literal: true
require 'fileutils'
module Overcommit
# Manages the installation of Overcommit hooks in a git repository.
class Installer # rubocop:disable Metrics/ClassLength
TEMPLATE_DIRECTORY = File.join(Overcommit::HOME, 'template-dir')
MASTER_HOOK = File.join(TEMPLATE_DIRECTORY, 'hooks'... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/lib/overcommit/configuration_loader.rb | lib/overcommit/configuration_loader.rb | # frozen_string_literal: true
require 'yaml'
module Overcommit
# Manages configuration file loading.
class ConfigurationLoader
DEFAULT_CONFIG_PATH = File.join(Overcommit::HOME, 'config', 'default.yml')
class << self
# Loads and returns the default configuration.
#
# @return [Overcommit:... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/lib/overcommit/cli.rb | lib/overcommit/cli.rb | # frozen_string_literal: true
require 'overcommit'
require 'optparse'
module Overcommit
# Responsible for parsing command-line options and executing appropriate
# application logic based on those options.
class CLI # rubocop:disable Metrics/ClassLength
def initialize(arguments, input, logger)
@argumen... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/lib/overcommit/printer.rb | lib/overcommit/printer.rb | # frozen_string_literal: true
require 'monitor'
module Overcommit
# Provide a set of callbacks which can be executed as events occur during the
# course of {HookRunner#run}.
class Printer
attr_reader :log
def initialize(config, logger, context)
@config = config
@log = logger
@context ... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/lib/overcommit/git_version.rb | lib/overcommit/git_version.rb | # frozen_string_literal: true
# Returns the version of the available git binary.
#
# This is intended to be used to conveniently execute code based on a specific
# git version. Simply compare to a version string:
#
# @example
# if GIT_VERSION <= '1.8.5'
# ...
# end
module Overcommit
GIT_VERSION = begin
v... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/lib/overcommit/hook_runner.rb | lib/overcommit/hook_runner.rb | # frozen_string_literal: true
module Overcommit
# Responsible for loading the hooks the repository has configured and running
# them, collecting and displaying the results.
class HookRunner # rubocop:disable Metrics/ClassLength
# @param config [Overcommit::Configuration]
# @param logger [Overcommit::Logg... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/lib/overcommit/git_config.rb | lib/overcommit/git_config.rb | # frozen_string_literal: true
require 'overcommit/utils'
module Overcommit
# Get configuration options from git
module GitConfig
module_function
def comment_character
char = `git config --get core.commentchar`.chomp
char = '#' if char == ''
char
end
def hooks_path
path = ... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/lib/overcommit/command_splitter.rb | lib/overcommit/command_splitter.rb | # frozen_string_literal: true
module Overcommit
# Distributes a list of arguments over multiple invocations of a command.
#
# This accomplishes the same functionality provided by `xargs` but in a
# cross-platform way that does not require any pre-existing tools.
#
# One of the tradeoffs with this approach ... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/lib/overcommit/interrupt_handler.rb | lib/overcommit/interrupt_handler.rb | # frozen_string_literal: true
require 'singleton'
# Provides a handler for interrupt signals (SIGINT), allowing the application to
# finish what it's currently working on.
class InterruptHandler
include Singleton
attr_accessor :isolate_signals, :signal_received, :reenable_on_interrupt
# Initialize safe interr... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/lib/overcommit/hook_context.rb | lib/overcommit/hook_context.rb | # frozen_string_literal: true
# Utility module which manages the creation of {HookContext}s.
module Overcommit::HookContext
def self.create(hook_type, config, args, input, **cli_options)
hook_type_class = Overcommit::Utils.camel_case(hook_type)
underscored_hook_type = Overcommit::Utils.snake_case(hook_type)
... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/lib/overcommit/hook/base.rb | lib/overcommit/hook/base.rb | # frozen_string_literal: true
require 'forwardable'
require 'overcommit/message_processor'
# Container for top-level hook-related classes and constants.
module Overcommit::Hook
# Helper containing metadata about error/warning messages returned by hooks.
Message = Struct.new(:type, :file, :line, :content) do
d... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/lib/overcommit/hook/post_rewrite/submodule_status.rb | lib/overcommit/hook/post_rewrite/submodule_status.rb | # frozen_string_literal: true
require 'overcommit/hook/shared/submodule_status'
module Overcommit::Hook::PostRewrite
# Checks the status of submodules in the current repository and
# notifies the user if any are uninitialized, out of date with
# the current index, or contain merge conflicts.
class SubmoduleSt... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/lib/overcommit/hook/post_rewrite/npm_install.rb | lib/overcommit/hook/post_rewrite/npm_install.rb | # frozen_string_literal: true
require 'overcommit/hook/shared/npm_install'
module Overcommit::Hook::PostRewrite
# Runs `npm install` when a change is detected in the repository's
# dependencies.
#
# @see Overcommit::Hook::Shared::NpmInstall
class NpmInstall < Base
include Overcommit::Hook::Shared::NpmIn... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/lib/overcommit/hook/post_rewrite/yarn_install.rb | lib/overcommit/hook/post_rewrite/yarn_install.rb | # frozen_string_literal: true
require 'overcommit/hook/shared/yarn_install'
module Overcommit::Hook::PostRewrite
# Runs `yarn install` when a change is detected in the repository's
# dependencies.
#
# @see Overcommit::Hook::Shared::YarnInstall
class YarnInstall < Base
include Overcommit::Hook::Shared::Y... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/lib/overcommit/hook/post_rewrite/bundle_install.rb | lib/overcommit/hook/post_rewrite/bundle_install.rb | # frozen_string_literal: true
require 'overcommit/hook/shared/bundle_install'
module Overcommit::Hook::PostRewrite
# Runs `bundle install` when a change is detected in the repository's
# dependencies.
#
# @see Overcommit::Hook::Shared::BundleInstall
class BundleInstall < Base
include Overcommit::Hook::S... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/lib/overcommit/hook/post_rewrite/base.rb | lib/overcommit/hook/post_rewrite/base.rb | # frozen_string_literal: true
require 'forwardable'
module Overcommit::Hook::PostRewrite
# Functionality common to all post-rewrite hooks.
class Base < Overcommit::Hook::Base
extend Forwardable
def_delegators :@context, :amend?, :rebase?, :rewritten_commits
end
end
| ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/lib/overcommit/hook/post_rewrite/index_tags.rb | lib/overcommit/hook/post_rewrite/index_tags.rb | # frozen_string_literal: true
require 'overcommit/hook/shared/index_tags'
module Overcommit::Hook::PostRewrite
# Updates ctags index for all source code in the repository.
#
# @see Overcommit::Hook::Shared::IndexTags
class IndexTags < Base
include Overcommit::Hook::Shared::IndexTags
def run
# I... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/lib/overcommit/hook/post_rewrite/composer_install.rb | lib/overcommit/hook/post_rewrite/composer_install.rb | # frozen_string_literal: true
require 'overcommit/hook/shared/composer_install'
module Overcommit::Hook::PostRewrite
# Runs `composer install` when a change is detected in the repository's
# dependencies.
#
# @see Overcommit::Hook::Shared::ComposerInstall
class ComposerInstall < Base
include Overcommit:... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/lib/overcommit/hook/post_rewrite/bower_install.rb | lib/overcommit/hook/post_rewrite/bower_install.rb | # frozen_string_literal: true
require 'overcommit/hook/shared/bower_install'
module Overcommit::Hook::PostRewrite
# Runs `bower install` when a change is detected in the repository's
# dependencies.
#
# @see Overcommit::Hook::Shared::BowerInstall
class BowerInstall < Base
include Overcommit::Hook::Share... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/lib/overcommit/hook/post_merge/submodule_status.rb | lib/overcommit/hook/post_merge/submodule_status.rb | # frozen_string_literal: true
require 'overcommit/hook/shared/submodule_status'
module Overcommit::Hook::PostMerge
# Checks the status of submodules in the current repository and
# notifies the user if any are uninitialized, out of date with
# the current index, or contain merge conflicts.
class SubmoduleStat... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/lib/overcommit/hook/post_merge/npm_install.rb | lib/overcommit/hook/post_merge/npm_install.rb | # frozen_string_literal: true
require 'overcommit/hook/shared/npm_install'
module Overcommit::Hook::PostMerge
# Runs `npm install` when a change is detected in the repository's
# dependencies.
#
# @see Overcommit::Hook::Shared::NpmInstall
class NpmInstall < Base
include Overcommit::Hook::Shared::NpmInst... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/lib/overcommit/hook/post_merge/yarn_install.rb | lib/overcommit/hook/post_merge/yarn_install.rb | # frozen_string_literal: true
require 'overcommit/hook/shared/yarn_install'
module Overcommit::Hook::PostMerge
# Runs `yarn install` when a change is detected in the repository's
# dependencies.
#
# @see Overcommit::Hook::Shared::YarnInstall
class YarnInstall < Base
include Overcommit::Hook::Shared::Yar... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/lib/overcommit/hook/post_merge/bundle_install.rb | lib/overcommit/hook/post_merge/bundle_install.rb | # frozen_string_literal: true
require 'overcommit/hook/shared/bundle_install'
module Overcommit::Hook::PostMerge
# Runs `bundle install` when a change is detected in the repository's
# dependencies.
#
# @see Overcommit::Hook::Shared::BundleInstall
class BundleInstall < Base
include Overcommit::Hook::Sha... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/lib/overcommit/hook/post_merge/base.rb | lib/overcommit/hook/post_merge/base.rb | # frozen_string_literal: true
require 'forwardable'
module Overcommit::Hook::PostMerge
# Functionality common to all post-merge hooks.
class Base < Overcommit::Hook::Base
extend Forwardable
def_delegators :@context, :modified_lines_in_file, :squash?, :merge_commit?
end
end
| ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/lib/overcommit/hook/post_merge/index_tags.rb | lib/overcommit/hook/post_merge/index_tags.rb | # frozen_string_literal: true
require 'overcommit/hook/shared/index_tags'
module Overcommit::Hook::PostMerge
# Updates ctags index for all source code in the repository.
#
# @see Overcommit::Hook::Shared::IndexTags
class IndexTags < Base
include Overcommit::Hook::Shared::IndexTags
end
end
| ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/lib/overcommit/hook/post_merge/composer_install.rb | lib/overcommit/hook/post_merge/composer_install.rb | # frozen_string_literal: true
require 'overcommit/hook/shared/composer_install'
module Overcommit::Hook::PostMerge
# Runs `composer install` when a change is detected in the repository's
# dependencies.
#
# @see Overcommit::Hook::Shared::ComposerInstall
class ComposerInstall < Base
include Overcommit::H... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/lib/overcommit/hook/post_merge/bower_install.rb | lib/overcommit/hook/post_merge/bower_install.rb | # frozen_string_literal: true
require 'overcommit/hook/shared/bower_install'
module Overcommit::Hook::PostMerge
# Runs `bower install` when a change is detected in the repository's
# dependencies.
#
# @see Overcommit::Hook::Shared::BowerInstall
class BowerInstall < Base
include Overcommit::Hook::Shared:... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/lib/overcommit/hook/commit_msg/spell_check.rb | lib/overcommit/hook/commit_msg/spell_check.rb | # frozen_string_literal: true
require 'tempfile'
module Overcommit::Hook::CommitMsg
# Checks the commit message for potential misspellings with `hunspell`.
#
# @see http://hunspell.sourceforge.net/
class SpellCheck < Base
Misspelling = Struct.new(:word, :suggestions)
MISSPELLING_REGEX = /^[&#]\s(?<wo... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/lib/overcommit/hook/commit_msg/gerrit_change_id.rb | lib/overcommit/hook/commit_msg/gerrit_change_id.rb | # frozen_string_literal: true
module Overcommit::Hook::CommitMsg
# Ensures a Gerrit Change-Id line is included in the commit message.
#
# It may seem odd to do this here instead of in a prepare-commit-msg hook, but
# the reality is that if you want to _ensure_ the Change-Id is included then
# you need to do ... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
sds/overcommit | https://github.com/sds/overcommit/blob/11838c67483be9f12580e271f83dfcb07ad62a2c/lib/overcommit/hook/commit_msg/single_line_subject.rb | lib/overcommit/hook/commit_msg/single_line_subject.rb | # frozen_string_literal: true
module Overcommit::Hook::CommitMsg
# Ensures commit message subject lines are followed by a blank line.
class SingleLineSubject < Base
def run
return :pass if empty_message?
unless commit_message_lines[1].to_s.strip.empty?
return :warn, 'Subject should be one ... | ruby | MIT | 11838c67483be9f12580e271f83dfcb07ad62a2c | 2026-01-04T15:47:52.694838Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.