-
Notifications
You must be signed in to change notification settings - Fork 0
Comparing changes
Open a pull request
base repository: fynsta/overcommit
base: main
head repository: sds/overcommit
compare: main
- 16 commits
- 27 files changed
- 9 contributors
Commits on Jun 24, 2024
-
Add changelog_uri to gemspec (sds#851)
Supported here: https://guides.rubygems.org/specification-reference/#metadata Useful for running https://github.com/MaximeD/gem_updater
Configuration menu - View commit details
-
Copy full SHA for 26e78aa - Browse repository at this point
Copy the full SHA 26e78aaView commit details
Commits on Jul 22, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 939d9e6 - Browse repository at this point
Copy the full SHA 939d9e6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5ff9d5e - Browse repository at this point
Copy the full SHA 5ff9d5eView commit details
Commits on Aug 11, 2024
-
Fix spec compatibility with recent git versions (sds#854)
The original array was defining the shellwords like this: `["git", "commit", "-m", "\"Resolve", "conflicts\"", "-i", "some-file"]` This combined with the most recent git version failed with: ``` error: pathspec 'conflicts"' did not match any file(s) known to git ``` This PR just simplifies the commit message to work with the %w array literal.
Configuration menu - View commit details
-
Copy full SHA for 5a3d68e - Browse repository at this point
Copy the full SHA 5a3d68eView commit details -
Expand tildes(~) for hooksPath (sds#853)
While installing overcommit git hooks i noticed that tildes are not expanded to home folders for the `hooksPath` config, the result was a tilde folder in the current directory. This PR addresses that by switching `File.absolute_path` to `File.expand_path`. The [underlaying implementation](https://github.com/ruby/ruby/blob/v3_3_4/file.c#L3753) in Ruby is exactly the same just with this difference in how `~` is handled. --------- Co-authored-by: Shane da Silva <shane@dasilva.io>
Configuration menu - View commit details
-
Copy full SHA for 31c83ce - Browse repository at this point
Copy the full SHA 31c83ceView commit details
Commits on Oct 31, 2024
-
Bump rexml to >= 3.3.9 to resolve GHSA-2rxp-v6pw-ch6m (sds#857)
A `ReDoS vulnerability in REXML` has been identified in versions <3.3.9 Details in GitHub: - GHSA-2rxp-v6pw-ch6m This is a small bump to the latest patched version. This should resolve anybody getting the following `bundle audit` error when using overcommit: ``` Name: rexml Version: 3.3.8 CVE: CVE-2024-49761 GHSA: GHSA-2rxp-v6pw-ch6m Criticality: High URL: GHSA-2rxp-v6pw-ch6m Title: REXML ReDoS vulnerability Solution: update to '>= 3.3.9' ```
Configuration menu - View commit details
-
Copy full SHA for 9825868 - Browse repository at this point
Copy the full SHA 9825868View commit details -
Configuration menu - View commit details
-
Copy full SHA for eff94a7 - Browse repository at this point
Copy the full SHA eff94a7View commit details
Commits on Jan 27, 2025
-
Load bundled gems on expected version (sds#859)
Fixes sds#789 `psych` is no longer a default gem, but current and old ruby still ships with it. When we `require 'yaml'`, we activate that gem in whatever version that is bundled with ruby. Later on, we load bundler, and we `Bundler.setup`, which will then activate whatever version specified in the lock file. More often than not, they might not match. The approach in this PR is to strip the `yaml` dependency completely from the hook scripts, while retaining the ability to configure the Gemfile using it.
Configuration menu - View commit details
-
Copy full SHA for 7d3e8fa - Browse repository at this point
Copy the full SHA 7d3e8faView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9ce5492 - Browse repository at this point
Copy the full SHA 9ce5492View commit details
Commits on Jan 30, 2025
-
Add
-diff
cli option for running precommit hooks against diffs (sds……#860) For example, running `overcommit --diff main` from a feature branch will run pre-commit hooks against the diff between the two branches. I was able to very easily leverage existing code for the bulk of the feature - this is mainly just adding the cli option, a hook context to do the execution and some tests based on the existing `--run-all` test. --- For background, my team is responsible for a couple of really old, really large rails apps. Getting them completely in compliance with our various linters is a huge task that isn't getting done anytime soon (things are funky to the point that we've even observed breakages with "safe" auto-correct functions). I introduced/started heavily encouraging overcommit so that we at least don't add _new_ linting offenses and things will naturally improve over time. It's been great, but offenses still slip through though here and there, especially with juniors who might be getting away with not having a local install (and/or abusing `OVERCOMMIT_DISABLE=1`). An option like this would allow me to leverage the very useful "only apply to changed lines" logic within a ci environment and help enforce my desired "no new linting offenses" policy.
Configuration menu - View commit details
-
Copy full SHA for b4d4ce0 - Browse repository at this point
Copy the full SHA b4d4ce0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 43e17fb - Browse repository at this point
Copy the full SHA 43e17fbView commit details
Commits on Feb 16, 2025
-
Restore ability to specify "gemfile: false" in config (sds#863)
Setting `gemfile: false` in `.overcommit.yml` is supposed to disable Bundler. However, a recently-introduced bug causes `false` to be interpreted as the name of the gemfile. Bundler looks for a gemfile named "false", which fails, leading overcommit's hooks to crash. This PR fixes the bug by adjusting the regex used to parse the `gemfile:` line in the config. Now, `false` is no longer interpreted as a gemfile name. I added an integration test to verify the fix. Fixes sds#862
Configuration menu - View commit details
-
Copy full SHA for 3db733e - Browse repository at this point
Copy the full SHA 3db733eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 88bee08 - Browse repository at this point
Copy the full SHA 88bee08View commit details
Commits on Feb 19, 2025
-
Add note about unsupported YAML features in
gemfile:
line in defaul……t.yml (sds#865) Related to sds#863 and [this comment](sds#862 (comment)): > Having a similar problem since we had this line in our `.overcommit.yml`: > > ```yaml > gemfile: Gemfile # enforce bundled version of overcommit > ``` > > And now overcommit doesn't strip out the inline comment, resulting in this weird looking error message: > > ``` > Problem loading 'Gemfile # enforce bundled version of overcommit': /path/to/project/Gemfile # enforce bundled version of overcommit not found > ``` I think adding support for comments in the `gemfile:` regexp is likely overkill and may still not be enough when the next person tries to use yet another YAML feature in that line, but perhaps this little warning would help someone else avoid tripping.
Configuration menu - View commit details
-
Copy full SHA for 9f142c2 - Browse repository at this point
Copy the full SHA 9f142c2View commit details
Commits on Mar 3, 2025
-
adds 'set' requirements to diff hook context. (sds#866)
Running `overcommit` with the `--diff` flag results in errors for version `0.67.0`. ```sh bundle exec overcommit --diff HEAD ``` It results on the following: ```ruby Running pre-commit hooks Check for case-insensitivity conflicts................[CaseConflicts] FAILED Hook raised unexpected error uninitialized constant Overcommit::Hook::PreCommit::CaseConflicts::Set repo_files = Set.new(applicable_files) ^^^ .bundle/ruby/3.1.0/gems/overcommit-0.67.0/lib/overcommit/hook/pre_commit/case_conflicts.rb:8:in `run' .bundle/ruby/3.1.0/gems/overcommit-0.67.0/lib/overcommit/hook/base.rb:47:in `block in run_and_transform' .bundle/ruby/3.1.0/gems/overcommit-0.67.0/lib/overcommit/utils.rb:260:in `with_environment' .bundle/ruby/3.1.0/gems/overcommit-0.67.0/lib/overcommit/hook/base.rb:47:in `run_and_transform' .bundle/ruby/3.1.0/gems/overcommit-0.67.0/lib/overcommit/hook_runner.rb:162:in `run_hook' .bundle/ruby/3.1.0/gems/overcommit-0.67.0/lib/overcommit/hook_runner.rb:98:in `block in consume' .bundle/ruby/3.1.0/gems/overcommit-0.67.0/lib/overcommit/hook_runner.rb:94:in `loop' .bundle/ruby/3.1.0/gems/overcommit-0.67.0/lib/overcommit/hook_runner.rb:94:in `consume' Analyze with RuboCop........................................[RuboCop] FAILED Hook raised unexpected error uninitialized constant Overcommit::GitRepo::Set lines = Set.new ^^^ .bundle/ruby/3.1.0/gems/overcommit-0.67.0/lib/overcommit/git_repo.rb:69:in `extract_modified_lines' .bundle/ruby/3.1.0/gems/overcommit-0.67.0/lib/overcommit/hook_context/diff.rb:17:in `modified_lines_in_file' /nix/store/0sj7d3r1kf95f27028j93j0sx3v6p1kw-ruby-3.1.6/lib/ruby/3.1.0/forwardable.rb:238:in `modified_lines_in_file' .bundle/ruby/3.1.0/gems/overcommit-0.67.0/lib/overcommit/message_processor.rb:145:in `message_on_modified_line?' .bundle/ruby/3.1.0/gems/overcommit-0.67.0/lib/overcommit/message_processor.rb:138:in `block in remove_ignored_messages' .bundle/ruby/3.1.0/gems/overcommit-0.67.0/lib/overcommit/message_processor.rb:138:in `select' .bundle/ruby/3.1.0/gems/overcommit-0.67.0/lib/overcommit/message_processor.rb:138:in `remove_ignored_messages' .bundle/ruby/3.1.0/gems/overcommit-0.67.0/lib/overcommit/message_processor.rb:45:in `handle_modified_lines' .bundle/ruby/3.1.0/gems/overcommit-0.67.0/lib/overcommit/message_processor.rb:39:in `hook_result' .bundle/ruby/3.1.0/gems/overcommit-0.67.0/lib/overcommit/hook/base.rb:263:in `process_hook_return_value' .bundle/ruby/3.1.0/gems/overcommit-0.67.0/lib/overcommit/hook/base.rb:48:in `run_and_transform' .bundle/ruby/3.1.0/gems/overcommit-0.67.0/lib/overcommit/hook_runner.rb:162:in `run_hook' .bundle/ruby/3.1.0/gems/overcommit-0.67.0/lib/overcommit/hook_runner.rb:98:in `block in consume' .bundle/ruby/3.1.0/gems/overcommit-0.67.0/lib/overcommit/hook_runner.rb:94:in `loop' .bundle/ruby/3.1.0/gems/overcommit-0.67.0/lib/overcommit/hook_runner.rb:94:in `consume' ✗ One or more pre-commit hooks failed ``` The problems are fixed once `set` is required in the context that the sub command is run. `run_all.rb` also requires `set` where the module is [defined](https://github.com/sds/overcommit/blob/main/lib/overcommit/hook_context/run_all.rb#L3).
Configuration menu - View commit details
-
Copy full SHA for 11ef06b - Browse repository at this point
Copy the full SHA 11ef06bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 46c3033 - Browse repository at this point
Copy the full SHA 46c3033View commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff main...main