fasterer icon indicating copy to clipboard operation
fasterer copied to clipboard

Report with links

Open dukaev opened this issue 5 years ago • 8 comments

Report with links will be more informative.

lib/code.rb:9 Use attr_reader for reading ivars [https://github.com/DamirSvrtan/fasterer/docs/attr_reader_vs_ivars.md]

dukaev avatar Feb 22 '19 00:02 dukaev

it might make sense to point these to the fast ruby repo as they are the source of truth for those issues.

DamirSvrtan avatar Feb 26 '19 00:02 DamirSvrtan

@dukaev would you wanna take a stab at this? If not, i'd close it.

DamirSvrtan avatar Feb 05 '20 05:02 DamirSvrtan

@DamirSvrtan yes. I'll do it within a week.

dukaev avatar Feb 05 '20 14:02 dukaev

In the first version, it will be possible to do it quickly. The second version allows configured output without links.

    EXPLANATIONS = {
      first: 'some warn [some_url.com]',
      second: {
        info: 'some warn',
        link: 'some_url.com'
      }
    }

@DamirSvrtan what do you think is the most suitable choice?

dukaev avatar Feb 07 '20 06:02 dukaev

Hi @dukaev 👋

I am sorry, I am not completely clear on your suggestion.

Is your first suggestion to do it like this:

    EXPLANATIONS = {
      first_offense: 'some warn [some_url.com]',
      second_offense: 'some other worn [some_other_url.com]'
    }

And the second one like this:

    EXPLANATIONS = {
      first_offense: {
        info: 'some_warn',
        link: 'some_url.com'
      },
      second_offense: {
        info: 'some other warn',
        link: 'some_other_url.com'
      }
    }

What do you think is the benefit of the first approach and what of the second one?

Would you link out all the reports to https://github.com/JuanitoFatas/fast-ruby ?

DamirSvrtan avatar Feb 09 '20 06:02 DamirSvrtan

Hello @DamirSvrtan 🙂

In the first approach, first_offense: 'some warn [some_url.com]': ➕ No need to edit the logic of output. Only edit EXPLANATIONS.

In the second first_offense: { info: 'some_warn', link: 'some_url.com' }: ➕ Allows to costomize output with links / without links.

Yes. Links to JuanitoFatas/fast-ruby. Like https://github.com/JuanitoFatas/fast-ruby#hash-vs-openstruct-creation-code

dukaev avatar Feb 09 '20 17:02 dukaev

Hey Dukaev, let's go with the second solution (or something similar) where it's easy to grab the key of the offense or the link of the offense without additional parsing.

DamirSvrtan avatar Feb 11 '20 05:02 DamirSvrtan

👋 @DamirSvrtan. Added PR #78

dukaev avatar Mar 06 '20 21:03 dukaev