ManageIQ / floe

Floe is a runner for Amazon States Language workflows
Apache License 2.0
0 stars 5 forks source link

Add spec/supports #248

Closed kbrock closed 2 months ago

kbrock commented 3 months ago

I tend to want to require "byebug" I put this into the supports directory (and don't commit)

This allows this and other local enhancement behavior

agrare commented 3 months ago

I tend to want to require "byebug"

We do have bundler-inject here already so I wonder if we need this then?

I have byebug in my global includes which sounds like what you're trying to do as well, but I end up having to require "byebug"; byebug also which is odd I wonder if that's a bundler-inject issue

Fryguy commented 3 months ago

We do need spec/supports for other stuff though - think you had another PR where you wanted to introduce example files, and a helper method around it? Also there are helper methods directly in the spec_helper.rb that should probably be moved to a proper spec/supports file.

kbrock commented 3 months ago

I have byebug in my global includes

Yup

$ cat ~/.bundler.d/Gemfile.global.rb
ensure_gem "byebug"

I end up having to require "byebug"; byebug

Yea, that is my exact use case. I have added a supports/byebug.rb file to all my other projects:

echo "require 'byebug'" > spec/supports/byebug.rb

So in code I can skip the require:

  byebug
kbrock commented 3 months ago

update:

kbrock commented 2 months ago

Line 21, Col 1 - Lint/NonDeterministicRequireOrder - Sort files before requiring them.

omg. I just changed this line because it said it was bad to sort first. The conflicting warnings are frustrating

Fryguy commented 2 months ago

it said it was bad to sort first.

I don't know what the code was doing before, but I assume you were hitting Lint/RedundantDirGlobSort ?

Lint/NonDeterministicRequireOrder calls that out kind of

Dir.glob and Dir[] sort globbed results by default in Ruby 3.0. So all bad cases are acceptable when Ruby 3.0 or higher are used. Note: This cop will be deprecated and removed when supporting only Ruby 3.0 and higher.

So I think we can ignore (or mark it as disabled if we really care).

kbrock commented 2 months ago

update:

miq-bot commented 2 months ago

Checked commits https://github.com/kbrock/floe/compare/b130a131f14b4d52851843ce29ec7c36cba98c3f~...e1ad8937f03924e38c69473a395a0a5dbde338e6 with ruby 3.1.5, rubocop 1.56.3, haml-lint 0.51.0, and yamllint 3 files checked, 0 offenses detected Everything looks fine. :cake: