Compare commits
12 commits
Author | SHA1 | Date | |
---|---|---|---|
a8afb17e70 | |||
|
04c2430096 | ||
8bfdecec21 | |||
|
0af937edac | ||
e894f65f30 | |||
567198c182 | |||
604fe35be6 | |||
120bb4b79a | |||
|
8fa719df7a | ||
24f5c56ce7 | |||
aa72af8c5a | |||
|
672ad20150 |
7 changed files with 17 additions and 19 deletions
|
@ -1,3 +1,6 @@
|
|||
require:
|
||||
- rubocop-rake
|
||||
|
||||
AllCops:
|
||||
NewCops: enable
|
||||
TargetRubyVersion: 2.7
|
||||
|
|
6
Gemfile
6
Gemfile
|
@ -8,3 +8,9 @@ group :ci do
|
|||
gem 'code-scanning-rubocop'
|
||||
gem 'rspec_junit_formatter'
|
||||
end
|
||||
|
||||
|
||||
gem 'rake', '~> 13.0'
|
||||
gem 'rspec'
|
||||
gem 'rubocop', '~> 1.29'
|
||||
gem 'rubocop-rake', '~> 0.6'
|
||||
|
|
15
Gemfile.lock
15
Gemfile.lock
|
@ -15,15 +15,14 @@ GEM
|
|||
json (2.7.2)
|
||||
language_server-protocol (3.17.0.3)
|
||||
parallel (1.25.1)
|
||||
parser (3.3.3.0)
|
||||
parser (3.3.4.0)
|
||||
ast (~> 2.4.1)
|
||||
racc
|
||||
racc (1.8.0)
|
||||
racc (1.8.1)
|
||||
rainbow (3.1.1)
|
||||
rake (13.2.1)
|
||||
regexp_parser (2.9.2)
|
||||
rexml (3.3.0)
|
||||
strscan
|
||||
rexml (3.3.9)
|
||||
rspec (3.13.0)
|
||||
rspec-core (~> 3.13.0)
|
||||
rspec-expectations (~> 3.13.0)
|
||||
|
@ -39,13 +38,13 @@ GEM
|
|||
rspec-support (3.13.1)
|
||||
rspec_junit_formatter (0.6.0)
|
||||
rspec-core (>= 2, < 4, != 2.12.0)
|
||||
rubocop (1.64.1)
|
||||
rubocop (1.65.1)
|
||||
json (~> 2.3)
|
||||
language_server-protocol (>= 3.17.0)
|
||||
parallel (~> 1.10)
|
||||
parser (>= 3.3.0.2)
|
||||
rainbow (>= 2.2.2, < 4.0)
|
||||
regexp_parser (>= 1.8, < 3.0)
|
||||
regexp_parser (>= 2.4, < 3.0)
|
||||
rexml (>= 3.2.5, < 4.0)
|
||||
rubocop-ast (>= 1.31.1, < 2.0)
|
||||
ruby-progressbar (~> 1.7)
|
||||
|
@ -54,10 +53,7 @@ GEM
|
|||
parser (>= 3.3.1.0)
|
||||
rubocop-rake (0.6.0)
|
||||
rubocop (~> 1.0)
|
||||
rubocop-rspec (3.0.1)
|
||||
rubocop (~> 1.61)
|
||||
ruby-progressbar (1.13.0)
|
||||
strscan (3.1.0)
|
||||
unicode-display_width (2.5.0)
|
||||
|
||||
PLATFORMS
|
||||
|
@ -71,7 +67,6 @@ DEPENDENCIES
|
|||
rspec_junit_formatter
|
||||
rubocop (~> 1.29)
|
||||
rubocop-rake (~> 0.6)
|
||||
rubocop-rspec
|
||||
|
||||
BUNDLED WITH
|
||||
2.1.4
|
||||
|
|
|
@ -17,7 +17,7 @@ parser = OptionParser.new do |opt|
|
|||
<<~DOC
|
||||
Shell command to format files, will run once per file. Occurrences of the placeholder `{}` will \
|
||||
be replaced with a path to the file being formatted. \
|
||||
(Example: "prettier --stdin-filepath \'{}\'")
|
||||
(Example: "prettier --stdin-filepath '{}'")
|
||||
DOC
|
||||
) do |o|
|
||||
parameters[:formatter] = o
|
||||
|
|
|
@ -19,12 +19,6 @@ Gem::Specification.new do |s|
|
|||
|
||||
s.add_dependency 'colorize'
|
||||
|
||||
s.add_development_dependency 'rake', '~> 13.0'
|
||||
s.add_development_dependency 'rspec'
|
||||
s.add_development_dependency 'rubocop', '~> 1.29'
|
||||
s.add_development_dependency 'rubocop-rake', '~> 0.6'
|
||||
s.add_development_dependency 'rubocop-rspec'
|
||||
|
||||
s.metadata = {
|
||||
'rubygems_mfa_required' => 'true'
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ module FormatStaged
|
|||
return false unless formatted.size == files.size
|
||||
|
||||
quiet = @verbose ? [] : ['--quiet']
|
||||
return !write || get_status('git', 'diff-index', '--cached', '--exit-code', *quiet, 'HEAD') != 0
|
||||
!write || get_status('git', 'diff-index', '--cached', '--exit-code', *quiet, 'HEAD') != 0
|
||||
end
|
||||
|
||||
def repo_root
|
||||
|
|
|
@ -132,7 +132,7 @@ describe FormatStaged do
|
|||
repo.set_content 'test.test', 'a=b'
|
||||
repo.stage 'test.test'
|
||||
|
||||
expect(repo.run_formatter write: false).to be_truthy
|
||||
expect(repo.run_formatter(write: false)).to be_truthy
|
||||
expect(repo.get_content('test.test')).to eq 'a=b'
|
||||
expect(repo.get_staged('test.test')).to eq 'a=b'
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue