Marc-André Lafortune
Marc-André Lafortune
I'm slaving on a refactoring of the `add_offense` / `autocorrect` API in #7868 and I will most likely introduce `Cop#source_buffer=`. Currently, some cops are simply setting `@source_buffer` directly. I will...
My PR now includes modern Cops being persisted accross files. The callbacks (now named `on_begin_walk` and `on_end_walk`) would allow you to store the current processed source, e.g. ``` def initialize(*)...
Given that the majority of cops (ours or custom) don't need to keep context and that it is difficult to test that a cop is clearing it's cache (if any),...
> Are there any cops that would benefit from this feature? Seems to me that some cops looking for duplications could definitely benefit from it. Duplicated spec, duplicated constant, duplicated...
> > Duplicated spec > > A spec for the same class in a different folder? Could be, or testing the same thing (say if there's a `shared_example` that should...
> What I mean is that bending RuboCop to do cross-file checks may not overweigh the added complexity It's basically done, I just have to test it and close this...
Totally slipped my mind, and I don't intend to, so I'm closing this.
This could be quite useful, but I'd venture to say that most deprecated methods will be instance methods, not class methods. A cop with inline nodepattern could be a more...
I might be a bit out of context here, but if most Rails cops need to be marked as unsafe, I see no issue with that. The meaning of "unsafe"...
A big file is ok too (just create a gist).