source stringclasses 1
value | repo stringlengths 5 63 | repo_url stringlengths 24 82 | path stringlengths 5 167 | language stringclasses 1
value | license stringclasses 5
values | stars int64 10 51.4k | ref stringclasses 23
values | size_bytes int64 200 258k | text stringlengths 137 258k |
|---|---|---|---|---|---|---|---|---|---|
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/post_checkout/composer_install_spec.rb | Ruby | mit | 3,997 | main | 745 | # 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... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/post_checkout/base_spec.rb | Ruby | mit | 3,997 | main | 2,004 | # 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... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/post_checkout/bower_install_spec.rb | Ruby | mit | 3,997 | main | 775 | # 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... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/post_checkout/submodule_status_spec.rb | Ruby | mit | 3,997 | main | 1,516 | # 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... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/post_checkout/npm_install_spec.rb | Ruby | mit | 3,997 | main | 729 | # 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... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/post_checkout/bundle_install_spec.rb | Ruby | mit | 3,997 | main | 741 | # 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... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/post_checkout/yarn_install_spec.rb | Ruby | mit | 3,997 | main | 729 | # 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 ... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/pre_rebase/merged_commits_spec.rb | Ruby | mit | 3,997 | main | 1,446 | # 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... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/pre_push/protected_branches_spec.rb | Ruby | mit | 3,997 | main | 3,202 | # frozen_string_literal: true
require 'spec_helper'
require 'overcommit/hook_context/pre_push'
describe Overcommit::Hook::PrePush::ProtectedBranches do
let(:hook_config) { {} }
let(:config) do
Overcommit::ConfigurationLoader.default_configuration.merge(
Overcommit::Configuration.new(
'PrePush' =... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/pre_push/cargo_test_spec.rb | Ruby | mit | 3,997 | main | 1,252 | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PrePush::CargoTest do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
context 'when all tests succeed' do
before do
... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/pre_push/brakeman_spec.rb | Ruby | mit | 3,997 | main | 817 | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PrePush::Brakeman do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
context 'when brakeman exits successfully' do
... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/pre_push/python_nose_spec.rb | Ruby | mit | 3,997 | main | 853 | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PrePush::PythonNose do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
context 'when nose exits successfully' do
... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/pre_push/rake_target_spec.rb | Ruby | mit | 3,997 | main | 1,378 | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PrePush::RakeTarget do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
context 'without targets parameters' do
let(:r... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/pre_push/go_test_spec.rb | Ruby | mit | 3,997 | main | 1,644 | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PrePush::GoTest do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
context 'when go test exits successfully' do
let(:... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/pre_push/test_unit_spec.rb | Ruby | mit | 3,997 | main | 1,079 | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PrePush::TestUnit do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context', all_files: ['test/foo_test.rb']) }
subject { described_class.new(config, context) }
context 'when test... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/pre_push/pytest_spec.rb | Ruby | mit | 3,997 | main | 853 | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PrePush::Pytest do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
context 'when pytest exits successfully' do
... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/pre_push/minitest_spec.rb | Ruby | mit | 3,997 | main | 1,076 | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PrePush::Minitest do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context', all_files: ['test/test_foo.rb']) }
subject { described_class.new(config, context) }
context 'when minit... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/pre_push/base_spec.rb | Ruby | mit | 3,997 | main | 2,768 | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PrePush::Base do
let(:remote_name) { 'origin' }
let(:remote_ref_deletion?) { false }
let(:config) { double('config') }
let(:context) { double('context') }
let(:hook) { described_class.new(config, context) }
describe '#run?' do... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/pre_push/golangci_lint_spec.rb | Ruby | mit | 3,997 | main | 1,752 | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PrePush::GolangciLint do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
context 'when golangci-lint exits successfully' ... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/pre_push/php_unit_spec.rb | Ruby | mit | 3,997 | main | 856 | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PrePush::PhpUnit do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
context 'when phpunit exits successfully' do
... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/pre_push/r_spec_spec.rb | Ruby | mit | 3,997 | main | 4,540 | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PrePush::RSpec do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
context 'when rspec exits successfully' do
let(:res... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/pre_push/flutter_test_spec.rb | Ruby | mit | 3,997 | main | 11,740 | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PrePush::FlutterTest do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
context 'when flutter test exits successfully' do... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/pre_push/pub_test_spec.rb | Ruby | mit | 3,997 | main | 1,639 | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PrePush::PubTest do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
context 'when pub test exits successfully' do
let... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/pre_push/pronto_spec.rb | Ruby | mit | 3,997 | main | 1,776 | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PrePush::Pronto 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... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/pre_push/mix_test_spec.rb | Ruby | mit | 3,997 | main | 858 | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PrePush::MixTest do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
context 'when mix test exits successfully' do
... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/post_rewrite/npm_install_spec.rb | Ruby | mit | 3,997 | main | 728 | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PostRewrite::NpmInstall do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
let(:result) { double('result') }
before do... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/post_rewrite/composer_install_spec.rb | Ruby | mit | 3,997 | main | 744 | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PostRewrite::ComposerInstall do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
let(:result) { double('result') }
befo... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/post_rewrite/bower_install_spec.rb | Ruby | mit | 3,997 | main | 774 | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PostRewrite::BowerInstall do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
let(:result) { double('result') }
before ... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/post_rewrite/submodule_status_spec.rb | Ruby | mit | 3,997 | main | 1,515 | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PostRewrite::SubmoduleStatus do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
let(:submodule_status) { double('submodul... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/post_rewrite/bundle_install_spec.rb | Ruby | mit | 3,997 | main | 740 | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PostRewrite::BundleInstall do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
let(:result) { double('result') }
before... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/post_rewrite/yarn_install_spec.rb | Ruby | mit | 3,997 | main | 728 | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PostRewrite::YarnInstall do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
let(:result) { double('result') }
before d... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/post_rewrite/index_tags_spec.rb | Ruby | mit | 3,997 | main | 354 | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PostMerge::IndexTags do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
before do
subject.stub(:execute_in_background... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/commit_msg/russian_novel_spec.rb | Ruby | mit | 3,997 | main | 627 | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::CommitMsg::RussianNovel do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
before do
context.stub(:commit_message_lin... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/commit_msg/spell_check_spec.rb | Ruby | mit | 3,997 | main | 1,765 | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::CommitMsg::SpellCheck do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
before do
subject.stub(:uncommented_commit_m... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/commit_msg/empty_message_spec.rb | Ruby | mit | 3,997 | main | 723 | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::CommitMsg::EmptyMessage do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
before do
context.stub(:empty_message?).an... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/commit_msg/text_width_spec.rb | Ruby | mit | 3,997 | main | 4,203 | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::CommitMsg::TextWidth do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
before do
context.stub(:commit_message_lines)... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/commit_msg/gerrit_change_id_spec.rb | Ruby | mit | 3,997 | main | 1,164 | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::CommitMsg::GerritChangeId do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
let(:commit_msg_file) { Tempfile.new('commit-... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/commit_msg/trailing_period_spec.rb | Ruby | mit | 3,997 | main | 826 | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::CommitMsg::TrailingPeriod do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
before do
context.stub(:commit_message_l... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/commit_msg/capitalized_subject_spec.rb | Ruby | mit | 3,997 | main | 2,418 | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::CommitMsg::CapitalizedSubject do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
before do
context.stub(:commit_messa... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/commit_msg/message_format_spec.rb | Ruby | mit | 3,997 | main | 1,615 | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::CommitMsg::MessageFormat do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
before do
context.stub(:commit_message_li... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/commit_msg/hard_tabs_spec.rb | Ruby | mit | 3,997 | main | 792 | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::CommitMsg::HardTabs do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
before do
context.stub(:commit_message).and_re... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/commit_msg/single_line_subject_spec.rb | Ruby | mit | 3,997 | main | 991 | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::CommitMsg::SingleLineSubject do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
before do
context.stub(:commit_messag... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/post_commit/index_tags_spec.rb | Ruby | mit | 3,997 | main | 355 | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PostCommit::IndexTags do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
before do
subject.stub(:execute_in_backgroun... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/post_commit/bundle_install_spec.rb | Ruby | mit | 3,997 | main | 739 | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PostCommit::BundleInstall do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
let(:result) { double('result') }
before ... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/post_commit/git_guilt_spec.rb | Ruby | mit | 3,997 | main | 1,188 | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PostCommit::GitGuilt do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
context 'when git-guilt exits successfully' do
... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/post_commit/npm_install_spec.rb | Ruby | mit | 3,997 | main | 727 | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PostCommit::NpmInstall do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
let(:result) { double('result') }
before do
... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/post_commit/yarn_install_spec.rb | Ruby | mit | 3,997 | main | 727 | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PostCommit::YarnInstall do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
let(:result) { double('result') }
before do... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/post_commit/composer_install_spec.rb | Ruby | mit | 3,997 | main | 743 | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PostCommit::ComposerInstall do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
let(:result) { double('result') }
befor... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/post_commit/commitplease_spec.rb | Ruby | mit | 3,997 | main | 857 | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PostCommit::Commitplease do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
let(:result) { double('result') }
before d... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/post_commit/bower_install_spec.rb | Ruby | mit | 3,997 | main | 773 | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PostCommit::BowerInstall do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
let(:result) { double('result') }
before d... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/post_commit/submodule_status_spec.rb | Ruby | mit | 3,997 | main | 1,514 | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PostCommit::SubmoduleStatus do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
let(:submodule_status) { double('submodule... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/post_merge/yarn_install_spec.rb | Ruby | mit | 3,997 | main | 726 | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PostMerge::YarnInstall do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
let(:result) { double('result') }
before do
... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/post_merge/bundle_install_spec.rb | Ruby | mit | 3,997 | main | 738 | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PostMerge::BundleInstall do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
let(:result) { double('result') }
before d... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/post_merge/composer_install_spec.rb | Ruby | mit | 3,997 | main | 742 | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PostMerge::ComposerInstall do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
let(:result) { double('result') }
before... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/post_merge/bower_install_spec.rb | Ruby | mit | 3,997 | main | 772 | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PostMerge::BowerInstall do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
let(:result) { double('result') }
before do... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/post_merge/npm_install_spec.rb | Ruby | mit | 3,997 | main | 726 | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PostMerge::NpmInstall do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
let(:result) { double('result') }
before do
... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/overcommit/hook/post_merge/submodule_status_spec.rb | Ruby | mit | 3,997 | main | 1,513 | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PostMerge::SubmoduleStatus do
let(:config) { Overcommit::ConfigurationLoader.default_configuration }
let(:context) { double('context') }
subject { described_class.new(config, context) }
let(:submodule_status) { double('submodule_... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/integration/disable_overcommit_spec.rb | Ruby | mit | 3,997 | main | 1,331 | # frozen_string_literal: true
require 'spec_helper'
describe 'disabling Overcommit' do
subject { shell(%w[git commit --allow-empty -m Test]) }
around do |example|
repo do
`overcommit --install > #{File::NULL}`
Overcommit::Utils.with_environment('OVERCOMMIT_DISABLE' => overcommit_disable) do
... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/integration/parallelize_spec.rb | Ruby | mit | 3,997 | main | 1,055 | # frozen_string_literal: true
require 'spec_helper'
require 'timeout'
describe 'running a hook with parallelism disabled' do
subject { shell(%w[git commit --allow-empty -m Test]) }
let(:config) { <<-YML }
concurrency: 20
CommitMsg:
TrailingPeriod:
enabled: true
parallelize: false
... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/integration/resolving_cherry_pick_conflict_spec.rb | Ruby | mit | 3,997 | main | 1,832 | # frozen_string_literal: true
require 'spec_helper'
describe 'resolving cherry-pick conflicts' do
subject { shell(%w[git commit -m Test -i some-file]) }
let(:config) { <<-YML }
PreCommit:
TrailingWhitespace:
enabled: true
YML
around do |example|
repo do
File.open('.overcommit.yml... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/integration/diff_flag_spec.rb | Ruby | mit | 3,997 | main | 1,016 | # frozen_string_literal: true
require 'spec_helper'
describe 'overcommit --diff' do
subject { shell(%w[overcommit --diff main]) }
context 'when using an existing pre-commit hook script' do
let(:script_name) { 'test-script' }
let(:script_contents) { "#!/bin/bash\nexit 0" }
let(:script_path) { ".#{Over... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/integration/resolving_merge_conflict_spec.rb | Ruby | mit | 3,997 | main | 1,069 | # frozen_string_literal: true
require 'spec_helper'
describe 'resolving merge conflicts' do
subject { shell(%w[git commit -m Test -i some-file]) }
around do |example|
repo do
echo('Master', 'some-file')
`git add some-file`
`git commit -m "Add some-file"`
`git checkout -q -b branch1`
... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/integration/configuration_signing_spec.rb | Ruby | mit | 3,997 | main | 2,287 | # frozen_string_literal: true
require 'spec_helper'
require 'yaml'
describe 'configuration file signing' do
let(:enable_verification) { true }
let(:new_verify_signatures) { verify_signatures }
let(:config) do
{
'verify_signatures' => verify_signatures,
'CommitMsg' => {
'ALL' => { 'enabl... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/integration/template_dir_spec.rb | Ruby | mit | 3,997 | main | 1,177 | # frozen_string_literal: true
require 'spec_helper'
require 'fileutils'
describe 'template directory' do
let(:template_dir) { File.join(Overcommit::HOME, 'template-dir') }
let(:hooks_dir) { File.join(template_dir, 'hooks') }
it 'contains a hooks directory' do
File.directory?(hooks_dir).should == true
end... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/integration/run_flag_spec.rb | Ruby | mit | 3,997 | main | 1,148 | # frozen_string_literal: true
require 'spec_helper'
describe 'overcommit --run' do
subject { shell(%w[overcommit --run]) }
context 'when using an existing pre-commit hook script' do
if Overcommit::OS.windows?
let(:script_name) { 'test-script.bat' }
let(:script_contents) { 'exit 0' }
else
... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/integration/gemfile_option_spec.rb | Ruby | mit | 3,997 | main | 4,547 | # frozen_string_literal: true
require 'spec_helper'
describe 'specifying `gemfile` option in Overcommit configuration' do
context 'given a project that uses a Gemfile' do
let(:repo_root) { File.expand_path(File.join('..', '..'), File.dirname(__FILE__)) }
let(:fake_gem_path) { File.join('lib', 'my_fake_gem')... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/integration/protected_branches_spec.rb | Ruby | mit | 3,997 | main | 7,396 | # frozen_string_literal: true
require 'spec_helper'
describe Overcommit::Hook::PrePush::ProtectedBranches,
if: Overcommit::GIT_VERSION >= '2.0' do
let(:flags) { '' }
let(:pushed_ref) { remote_ref }
subject do
shell("git push #{flags} origin #{pushed_ref}:#{remote_ref}".split)
end
let(:config) ... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/integration/installing_overcommit_spec.rb | Ruby | mit | 3,997 | main | 1,230 | # frozen_string_literal: true
require 'spec_helper'
describe 'installing Overcommit' do
let(:enable_verification) { true }
it 'signs the configuration file' do
repo do
`overcommit --install`
touch('some-file')
`git add some-file`
result = shell(%w[git commit --allow-empty -m Test])
... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/integration/hook_signing_spec.rb | Ruby | mit | 3,997 | main | 2,796 | # frozen_string_literal: true
require 'spec_helper'
require 'yaml'
describe 'hook signing' do
let(:enable_verification) { true }
let(:fake_hook_config) do
{
'enabled' => true,
'requires_files' => false,
'required_executable' => script_path,
}
end
let(:script_path) do
Overcommit:... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/integration/committing_spec.rb | Ruby | mit | 3,997 | main | 2,363 | # frozen_string_literal: true
require 'spec_helper'
describe 'commiting' do
subject { shell(%w[git commit --allow-empty -m Test]) }
let(:config) { <<-YML }
CommitMsg:
ALL:
enabled: false
PreCommit:
ALL:
enabled: false
AuthorName:
enabled: true
YML
around do ... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/support/shell_helpers.rb | Ruby | mit | 3,997 | main | 1,203 | # frozen_string_literal: true
require 'timeout'
require 'overcommit/subprocess'
# Helpers for executing shell commands in tests.
module ShellHelpers
def shell(command)
Overcommit::Subprocess.spawn(command)
end
def symlink(source, dest)
Overcommit::Utils::FileUtils.symlink(source, dest)
end
def tou... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/support/git_spec_helpers.rb | Ruby | mit | 3,997 | main | 1,948 | # frozen_string_literal: true
require 'tmpdir'
# Helpers for creating temporary repositories and directories for testing.
module GitSpecHelpers
module_function
# Creates an empty git repository, allowing you to execute a block where
# the current working directory is set to that repository's root directory.
... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/support/normalize_indent.rb | Ruby | mit | 3,997 | main | 387 | # frozen_string_literal: true
# Strips off excess leading indentation from each line so we can use Heredocs
# for writing code without having the leading indentation count.
module IndentNormalizer
def normalize_indent(code)
leading_indent = code[/^(\s*)/, 1]
code.lstrip.gsub(/\n#{leading_indent}/, "\n")
en... |
github | sds/overcommit | https://github.com/sds/overcommit | spec/support/output_helpers.rb | Ruby | mit | 3,997 | main | 272 | # frozen_string_literal: true
# Helpers for capturing output streams in tests.
module OutputHelpers
module_function
def capture_stdout
original = $stdout
$stdout = output = StringIO.new
yield
output.string
ensure
$stdout = original
end
end |
github | sds/overcommit | https://github.com/sds/overcommit | spec/support/matchers/hook.rb | Ruby | mit | 3,997 | main | 2,754 | # frozen_string_literal: true
# General spec matcher logic for checking hook status and output.
class HookMatcher
def initialize(status, args)
options = args.empty? ? {} : { message: args.first }
@expected_status = status
@expected_message = options[:message]
end
def matches?(check)
result = [ch... |
github | sds/overcommit | https://github.com/sds/overcommit | .git-hooks/pre_commit/master_hooks_match.rb | Ruby | mit | 3,997 | main | 859 | # frozen_string_literal: true
require 'fileutils'
module Overcommit::Hook::PreCommit
# Ensures all master hooks have the same content.
#
# This is necessary because we can't use symlinks to link all the hooks in the
# template directory to the master `overcommit-hook` file, since symlinks are
# not supporte... |
github | sds/overcommit | https://github.com/sds/overcommit | lib/overcommit.rb | Ruby | mit | 3,997 | main | 870 | # 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... |
github | sds/overcommit | https://github.com/sds/overcommit | lib/overcommit/hook_context.rb | Ruby | mit | 3,997 | main | 768 | # 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)
... |
github | sds/overcommit | https://github.com/sds/overcommit | lib/overcommit/os.rb | Ruby | mit | 3,997 | main | 666 | # 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 ... |
github | sds/overcommit | https://github.com/sds/overcommit | lib/overcommit/configuration.rb | Ruby | mit | 3,997 | main | 11,135 | # 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... |
github | sds/overcommit | https://github.com/sds/overcommit | lib/overcommit/cli.rb | Ruby | mit | 3,997 | main | 7,203 | # 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... |
github | sds/overcommit | https://github.com/sds/overcommit | lib/overcommit/logger.rb | Ruby | mit | 3,997 | main | 2,509 | # 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.
#
... |
github | sds/overcommit | https://github.com/sds/overcommit | lib/overcommit/hook_runner.rb | Ruby | mit | 3,997 | main | 6,790 | # 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... |
github | sds/overcommit | https://github.com/sds/overcommit | lib/overcommit/command_splitter.rb | Ruby | mit | 3,997 | main | 5,512 | # 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 ... |
github | sds/overcommit | https://github.com/sds/overcommit | lib/overcommit/configuration_validator.rb | Ruby | mit | 3,997 | main | 6,526 | # 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... |
github | sds/overcommit | https://github.com/sds/overcommit | lib/overcommit/installer.rb | Ruby | mit | 3,997 | main | 5,529 | # 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'... |
github | sds/overcommit | https://github.com/sds/overcommit | lib/overcommit/git_config.rb | Ruby | mit | 3,997 | main | 491 | # 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 = ... |
github | sds/overcommit | https://github.com/sds/overcommit | lib/overcommit/git_version.rb | Ruby | mit | 3,997 | main | 423 | # 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... |
github | sds/overcommit | https://github.com/sds/overcommit | lib/overcommit/exceptions.rb | Ruby | mit | 3,997 | main | 1,925 | # 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... |
github | sds/overcommit | https://github.com/sds/overcommit | lib/overcommit/configuration_loader.rb | Ruby | mit | 3,997 | main | 3,779 | # 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:... |
github | sds/overcommit | https://github.com/sds/overcommit | lib/overcommit/git_repo.rb | Ruby | mit | 3,997 | main | 9,917 | # 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
[^... |
github | sds/overcommit | https://github.com/sds/overcommit | lib/overcommit/subprocess.rb | Ruby | mit | 3,997 | main | 2,884 | # 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... |
github | sds/overcommit | https://github.com/sds/overcommit | lib/overcommit/interrupt_handler.rb | Ruby | mit | 3,997 | main | 2,442 | # 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... |
github | sds/overcommit | https://github.com/sds/overcommit | lib/overcommit/printer.rb | Ruby | mit | 3,997 | main | 4,182 | # 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 ... |
github | sds/overcommit | https://github.com/sds/overcommit | lib/overcommit/message_processor.rb | Ruby | mit | 3,997 | main | 4,588 | # 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}... |
github | sds/overcommit | https://github.com/sds/overcommit | lib/overcommit/constants.rb | Ruby | mit | 3,997 | main | 417 | # 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... |
github | sds/overcommit | https://github.com/sds/overcommit | lib/overcommit/hook_signer.rb | Ruby | mit | 3,997 | main | 3,906 | # 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... |
github | sds/overcommit | https://github.com/sds/overcommit | lib/overcommit/utils.rb | Ruby | mit | 3,997 | main | 9,866 | # frozen_string_literal: true
require 'etc'
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 n... |
github | sds/overcommit | https://github.com/sds/overcommit | lib/overcommit/hook_context/pre_rebase.rb | Ruby | mit | 3,997 | main | 1,080 | # frozen_string_literal: true
module Overcommit::HookContext
# Contains helpers related to contextual information used by pre-rebase
# hooks.
class PreRebase < Base
# Returns the name of the branch we are rebasing onto.
def upstream_branch
@args[0]
end
# Returns the name of the branch bein... |
github | sds/overcommit | https://github.com/sds/overcommit | lib/overcommit/hook_context/diff.rb | Ruby | mit | 3,997 | main | 984 | # frozen_string_literal: true
require 'overcommit/git_repo'
require 'set'
module Overcommit::HookContext
# Simulates a pre-commit context based on the diff with another git ref.
#
# This results in pre-commit hooks running against the changes between the current
# and another ref, which is useful for automat... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.