Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add to_s on file path comparison #25

Merged

Conversation

EduardoRSeifert
Copy link
Contributor

@EduardoRSeifert EduardoRSeifert commented Oct 17, 2024

This PR should fix the this issue: #24.
The issue happens because the comparison between a Pathname and a string fails. I chose to cast both to string to avoid a similar error in the future, but that can be removed if necessary

before:

✗ bundle exec pronto run -c origin/master
bundler: failed to load command: pronto (/home/eduardoseifert/.asdf/installs/ruby/3.3.4/bin/pronto)
/home/eduardoseifert/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/pronto-flay-0.11.1/lib/pronto/flay.rb:40:in `block in messages': undefined method `added_lines' for nil (NoMethodError)

        line = patch.added_lines.find do |added_line|
                    ^^^^^^^^^^^^
	from /home/eduardoseifert/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/pronto-flay-0.11.1/lib/pronto/flay.rb:37:in `map'
	from /home/eduardoseifert/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/pronto-flay-0.11.1/lib/pronto/flay.rb:37:in `messages'
	from /home/eduardoseifert/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/pronto-flay-0.11.1/lib/pronto/flay.rb:14:in `run'
	from /home/eduardoseifert/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/pronto-0.11.2/lib/pronto/runners.rb:20:in `block in run'
	from /home/eduardoseifert/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/pronto-0.11.2/lib/pronto/runners.rb:13:in `each'
	from /home/eduardoseifert/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/pronto-0.11.2/lib/pronto/runners.rb:13:in `run'
	from /home/eduardoseifert/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/pronto-0.11.2/lib/pronto.rb:66:in `run'
	from /home/eduardoseifert/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/pronto-0.11.2/lib/pronto/cli.rb:70:in `block in run'
	from /home/eduardoseifert/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/pronto-0.11.2/lib/pronto/cli.rb:68:in `chdir'
	from /home/eduardoseifert/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/pronto-0.11.2/lib/pronto/cli.rb:68:in `run'
	from /home/eduardoseifert/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/thor-1.3.2/lib/thor/command.rb:28:in `run'
	from /home/eduardoseifert/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/thor-1.3.2/lib/thor/invocation.rb:127:in `invoke_command'
	from /home/eduardoseifert/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/thor-1.3.2/lib/thor.rb:538:in `dispatch'
	from /home/eduardoseifert/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/thor-1.3.2/lib/thor/base.rb:584:in `start'
	from /home/eduardoseifert/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/pronto-0.11.2/bin/pronto:6:in `<top (required)>'
	from /home/eduardoseifert/.asdf/installs/ruby/3.3.4/bin/pronto:25:in `load'
	from /home/eduardoseifert/.asdf/installs/ruby/3.3.4/bin/pronto:25:in `<top (required)>'
	from /home/eduardoseifert/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/bundler-2.5.9/lib/bundler/cli/exec.rb:58:in `load'
	from /home/eduardoseifert/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/bundler-2.5.9/lib/bundler/cli/exec.rb:58:in `kernel_load'
	from /home/eduardoseifert/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/bundler-2.5.9/lib/bundler/cli/exec.rb:23:in `run'
	from /home/eduardoseifert/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/bundler-2.5.9/lib/bundler/cli.rb:451:in `exec'
	from /home/eduardoseifert/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/bundler-2.5.9/lib/bundler/vendor/thor/lib/thor/command.rb:28:in `run'
	from /home/eduardoseifert/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/bundler-2.5.9/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
	from /home/eduardoseifert/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/bundler-2.5.9/lib/bundler/vendor/thor/lib/thor.rb:527:in `dispatch'
	from /home/eduardoseifert/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/bundler-2.5.9/lib/bundler/cli.rb:34:in `dispatch'
	from /home/eduardoseifert/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/bundler-2.5.9/lib/bundler/vendor/thor/lib/thor/base.rb:584:in `start'
	from /home/eduardoseifert/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/bundler-2.5.9/lib/bundler/cli.rb:28:in `start'
	from /home/eduardoseifert/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/bundler-2.5.9/exe/bundle:28:in `block in <top (required)>'
	from /home/eduardoseifert/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/bundler-2.5.9/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
	from /home/eduardoseifert/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/bundler-2.5.9/exe/bundle:20:in `<top (required)>'
	from /home/eduardoseifert/.asdf/installs/ruby/3.3.4/bin/bundle:25:in `load'
	from /home/eduardoseifert/.asdf/installs/ruby/3.3.4/bin/bundle:25:in `<main>'

after:

✗ bundle exec pronto run -c origin/master
/home/eduardoseifert/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/pronto-rubocop-0.11.5/lib/pronto/rubocop/patch_cop.rb:34: warning: `Cop.all` is deprecated. Use `Registry.all` instead.

/home/eduardoseifert/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/pronto-rubocop-0.11.5/lib/pronto/rubocop/patch_cop.rb:62: warning: `inspect_file` is deprecated. Use `investigate` instead.

...

@EduardoRSeifert EduardoRSeifert requested a review from a team as a code owner October 17, 2024 20:15
@EduardoRSeifert EduardoRSeifert changed the title fix: add to_s on file pah comparison fix: add to_s on file path comparison Oct 17, 2024
jfedick pushed a commit to waggl/pronto-flay that referenced this pull request Oct 23, 2024
@ashkulz ashkulz merged commit bc1a7b2 into prontolabs:master Nov 30, 2024
7 of 9 checks passed
@ashkulz
Copy link
Member

ashkulz commented Nov 30, 2024

Thanks for the contribution, @EduardoRSeifert! Sorry for the delay.

@EduardoRSeifert
Copy link
Contributor Author

no problem, @ashkulz ! happy to help

@ashkulz
Copy link
Member

ashkulz commented Jan 11, 2025

0.11.2 has been released to RubyGems. Publishing future versions should be simpler due to implementation of Trusted Publishing workflow (aadea4b) 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants