Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: sds/overcommit
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.67.0
Choose a base ref
...
head repository: sds/overcommit
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.67.1
Choose a head ref
  • 3 commits
  • 4 files changed
  • 3 contributors

Commits on Feb 19, 2025

  1. Add note about unsupported YAML features in gemfile: line in defaul…

    …t.yml (#865)
    
    Related to #863 and [this
    comment](#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.
    pilaf authored Feb 19, 2025
    Configuration menu
    Copy the full SHA
    9f142c2 View commit details
    Browse the repository at this point in the history

Commits on Mar 3, 2025

  1. adds 'set' requirements to diff hook context. (#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).
    rscnt authored Mar 3, 2025
    Configuration menu
    Copy the full SHA
    11ef06b View commit details
    Browse the repository at this point in the history
  2. Cut version 0.67.1

    sds committed Mar 3, 2025
    Configuration menu
    Copy the full SHA
    46c3033 View commit details
    Browse the repository at this point in the history
Loading