Open 0xLucqs opened 1 month ago
I'd like to take ownership of this issue. My approach will be to first confirm that the syntax of the clippy.toml file adheres to the intended format for disallowed methods and functions. Specifically, I'll ensure that both string and inline table formats are supported, as shown in the example, and that the reason field is properly handled when provided.
Once the configuration parsing is verified, I'll:
Test Existing Configurations: Create test cases based on the provided examples to ensure Clippy issues warnings for disallowed methods such as Clone::clone, and that custom messages (like "no cloning arrays") are shown when specified in the config.
Extend Linting Capabilities: If needed, I’ll expand the lint to cover edge cases or additional method paths that might not currently be captured, ensuring Clippy correctly warns against all methods listed in clippy.toml.
Ensure Flexibility and Clarity: I will ensure the implementation remains flexible, allowing for future extension of disallowed methods and functions in a way that’s easy to configure in the .toml file.
Documentation & Examples: Update any relevant documentation to clarify how to use this feature, ensuring users can properly configure the clippy.toml file for their specific needs.
I’ll also make sure that any existing functionality continues to work as expected, and I'll write additional tests to validate these changes.
Let me know if this approach works for you, and I’ll get started right away!
Hey @Gianfranco99! Thanks for showing interest. We've created an application for you to contribute to Cairo lint. Go check it out on OnlyDust!
Hi @0xLucqs , please can I be assigned please?
Hey @od-hunter! Thanks for showing interest. We've created an application for you to contribute to Cairo lint. Go check it out on OnlyDust!
yes @od-hunter
@0xLucqs , thanks for assigning me ser. I’d need your assistance as I am not 100% clear on what I am supposed to do please.
hello i think that we'll cancel the issue, did you start anything ?
What it does
Denies the configured methods and functions in clippy.toml
Note: Even though this lint is warn-by-default, it will only trigger if methods are defined in the clippy.toml file.
Why is this bad?
Some methods are undesirable in certain contexts, and it’s beneficial to lint for them as needed.
Example
An example clippy.toml configuration:
(not entirely sure about the syntax of this toml but should probably look like that
Use instead: