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

Feature Request: Line-level Inline Exclusions #91

Open
ChefAustin opened this issue Jul 15, 2021 · 5 comments
Open

Feature Request: Line-level Inline Exclusions #91

ChefAustin opened this issue Jul 15, 2021 · 5 comments

Comments

@ChefAustin
Copy link

I think it would be a great enhancement if I was able to disable/exclude a speed suggestion for a specific line via a magic comment (much like how Rubocop does single-instance cop-disablement; # rubocop:disable Metrics/LineLength).

There are times where a single speedup in a given line of code is not applicable and I want to disable the speedup for the line but I don't want to have to add the entire file to the exclude_paths block of .fasterer.yml.

For example, if I have instance whereby I've used Hash#keys.each two times in a single file and one of those two times the hash is modified during the .each block (but the other time, the hash is not modified during the .each block) then I would want fasterer to ignore that singular instance of Hash#keys.each where the hash is modified (while still letting fasterer analyze the other instance of Hash#keys.each where the hash is not modified).

Hopefully this makes sense and seems reasonable!

Thanks for all the work put into fasterer over the years; it has certainly made some of my code... well... fasterer. 😄

@DamirSvrtan
Copy link
Owner

Hi @ChefAustin! Thanks for the suggestion, I see it is well accepted by looking at the number of upvotes. Do you potentially have the bandwidth to try to do a proof of concept how it would work?

@ChefAustin
Copy link
Author

I very much wish I currently had the free time to do a PoC on this feature. I am hoping that in the coming months I might be able to get around to poking at it.

When I do eventually have the time, I'll need to first do a deep-dive into the mechanics of fasterer and see how it works (because, tbh, right now its a bit of a blackbox of awesome magic to me).

@DamirSvrtan
Copy link
Owner

Sounds good! :) If there isn't any movement on this in the next 6 months, i'll close it out :)

@erikng
Copy link

erikng commented Oct 18, 2023

Any chance of merging the open PR that adds this functionality? Currently fasterer is a hammer and both opt-out options are not ideal.

@Frexuz
Copy link

Frexuz commented Jul 1, 2024

Would love this too 😿

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

No branches or pull requests

4 participants