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

When loading a cache, rubocop should let the user know #8842

Closed
hatkyinc2 opened this issue Oct 3, 2020 · 3 comments
Closed

When loading a cache, rubocop should let the user know #8842

hatkyinc2 opened this issue Oct 3, 2020 · 3 comments

Comments

@hatkyinc2
Copy link
Contributor

hatkyinc2 commented Oct 3, 2020

Is your feature request related to a problem? Please describe.

As a user that tried to debug an issue #8804, and I'm guessing #8755
I was surprised to learn that rubocop has a cache.
The behaviour and code path using the cache is different in some way, even if it's just due to code bugs
It might only be a debugging concern and not a normal golden path, but so is the cache path itself optimising..
It might improve issue reporting, handling and testing as it would be obvious in the output.
I think it's common to announce when cached is used in other utilities, but I can't at the moment name particular examples.

Describe the solution you'd like

Output a line at least in the default formater when cache is successfully loaded, indicating something like

Cache loaded from ~/.cache/rubocop

Probably as the first line before the normal output.

I don't think formaters like json actually need it, but it can become an attribute in the summery if that makes more sense to be good cross formaters...

Describe alternatives you've considered

An alternative would probably to only add it to the --debug option, but than I'd recommend that would come with updating the issue template to run and paste an output with that.

Or just have running with no cache -C false in the issue submission as the MVP..

Additional context

This is an example of a bug I think I found with the caching, where it doesn't save the issue status as it was discovered, it saves a hard-coded value
https://github.com/rubocop-hq/rubocop/pull/8841/files

@marcandre
Copy link
Contributor

marcandre commented Oct 4, 2020

Seems reasonable to me, WDYT @bbatsov ?

@bbatsov
Copy link
Collaborator

bbatsov commented Oct 4, 2020

Output a line at least in the default formater when cache is successfully loaded, indicating something like

I don't think this belongs to a formatter, but we can output the information somewhere. As the cache was meant to be transparent I'm leaning towards showing some message only in debug mode.

@hatkyinc2
Copy link
Contributor Author

hatkyinc2 pushed a commit to hatkyinc2/rubocop that referenced this issue Oct 5, 2020
* When rubocop is ran in debug mode (`--debug`) and rubocop uses a cache, output the location of cache used. (This is to inform about possible differences between runs..)
* Encourage users submitting bugs to use debug mode.
@bbatsov bbatsov closed this as completed in c2b4c37 Oct 5, 2020
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

No branches or pull requests

3 participants