inaka / elvis_core

The core of an Erlang linter
Other
61 stars 56 forks source link

Ets fun2ms without ms transform #374

Closed bormilan closed 1 day ago

bormilan commented 1 week ago

Description

It detects if a module that does not include ms_transform.hrl has any ets:fun2ms function call.

Closes #313;

bormilan commented 5 days ago

Oh yes, that is a way better approach. Thanks!

bormilan commented 5 days ago

I made some changes based on your suggestions. However, I believe this rule could be more generic. Currently, it only checks for a specific scenario, but we can expand it.

We could create a rule that detects any function call that requires an include but does not have it. We can add this scenario to the default configuration, and users can also add their own pairs of {function_call, lib_file_name} if they wish.

elbrujohalcon commented 4 days ago

@bormilan We can do that in another ticket. Please write a ticket for that. For now, I think we're fine. There are very few (if any) other cases of functions that require a header file. The only one I can think of is lager:debug(…) and other functions like that. But that's a third party library that's being obsoleted by OTP's logger, anyway. And it's not exactly an hrl what you need… it's a parse_transform. So, it's not 100% the same.

bormilan commented 4 days ago

Okay, it sounds

A few tiny improvements in code and docs… and do consider adding the tests I requested in my previous review, @bormilan. Thanks.

Yes, I will add that test, I didn't forget.

bormilan commented 4 days ago

@bormilan We can do that in another ticket. Please write a ticket for that. For now, I think we're fine. There are very few (if any) other cases of functions that require a header file. The only one I can think of is lager:debug(…) and other functions like that. But that's a third party library that's being obsoleted by OTP's logger, anyway. And it's not exactly an hrl what you need… it's a parse_transform. So, it's not 100% the same.

Okay, It sounds good!

bormilan commented 2 days ago

If you feel like ignoring the nit-picky comments, @bormilan … just let me know and I'll merge the PR as-is.

No, I'm grateful for your time, and I want to bring home as much as I can from these, so please be as nit-picky as you want, I really appreciate it! 🙌

Some say, "God is in the details." I want to appreciate this project with the best work I can do for the opportunities it provides me on my journey.