diff --git a/bin/git-format-staged b/bin/git-format-staged index 41d0829..2111bcc 100755 --- a/bin/git-format-staged +++ b/bin/git-format-staged @@ -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 diff --git a/lib/format-staged/job.rb b/lib/format-staged/job.rb index 18bacc8..176b099 100644 --- a/lib/format-staged/job.rb +++ b/lib/format-staged/job.rb @@ -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 diff --git a/spec/test_spec.rb b/spec/test_spec.rb index ce53719..26fc0ff 100644 --- a/spec/test_spec.rb +++ b/spec/test_spec.rb @@ -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