planetary-social / nos

nos.social social media for all of us, using nostr
https://nos.social
Mozilla Public License 2.0
120 stars 14 forks source link

Excessive use of disabled commands in SwiftLint #732

Open vigotskij opened 9 months ago

vigotskij commented 9 months ago

Description:

I've observed a substantial number of disabled commands for SwiftLint in the codebase, which seems to counter the purpose of utilizing this tool effectively. The essence of SwiftLint lies in establishing and adhering to clear coding rules, contributing to improved code readability and clarity. However, the prevalent practice of disabling rules without adequate explanation can create confusion and convey the notion that exceptions override the rules.

Suggested Improvements:

1. Clear Documentation for Disabled Rules:

It would be beneficial to encourage contributors to provide clear explanations when disabling specific rules. This documentation can serve as valuable guidance for anyone entering the codebase, fostering a better understanding of the rationale behind each exception.

2. Contextual Rule Exceptions for Tests:

Introducing a feature that excludes certain rules during the parsing of test files could be beneficial. Tests often require different considerations, and exempting them from certain rules can lead to more flexible and contextually appropriate linting.

3. Enforcement of Healthier Coding Practices:

It's worth considering enforcing rules that encourage healthier coding practices, such as favoring optionals over force unwrapping. Incorporating these rules not only aligns with best practices but also contributes to a more robust and maintainable codebase.

Objective:

The objective is to enhance the effectiveness of SwiftLint as a code quality tool by minimizing the excessive use of disabled commands. This, in turn, will contribute to a more consistent, readable, and maintainable codebase.

joshuatbrown commented 4 months ago

@vigotskij thanks again for another great suggestion! I totally agree, so I've moved this into our backlog so we can prioritize it.