Comments (6)
We can make the rule configurable. I'd prefer to keep this check under var-naming
so we can be as compatible with golint
as possible.
If you have some spare time, it'll be great if you can give it a try! We can discuss the approach you're planning here so we can collect some more thoughts! // cc @chavacava
from revive.
As described by @cvbarros, the configuration with an optional (empty by default) white list of "relaxed" initialisms seems the most flexible approach. It may lead to inconsistencies across projects but not more than adding a new rule (option 3).
from revive.
I'm thinking of two options:
- Allow developers to provide a custom list of initialisms. By default, we use the built-in one
- Allow developers to add extra valid Initialisms
The second aligns with what you mentioned, and the configuration will be less verbose in case the only initialisms a developer wants to alter is Id
, so we can go with it.
from revive.
I think that 2
will also provide a less verbose, while still flexible approach. Feel free to work on it if you want, otherwise I'll give it a try next week 👍
from revive.
@cvbarros I won't be able to work on it shortly. Assigned the issue to you so you can take care.
from revive.
I implemented this feature right here.
Let me know if you have other suggestions.
from revive.
Related Issues (20)
- Support Suggested Fixes (--fix) HOT 2
- Comment spacing isn't being ignored
- rule `exported` add `checkPublicInterface` option to check documentation in public interface definition HOT 1
- Rule `optimize-operands-order` reports potentially dangerous change when `len` of slice is used before slice accesing. HOT 2
- negative add-constant report when expr is not **ast.Ident**
- Multiple scopes to string-format rule HOT 1
- Exclude files base on patterns
- New release for Go 1.22 support? HOT 2
- Params column position incorrect if placed on new line HOT 4
- Request: treat min, max and clear as built-in functions HOT 1
- Request: report "redefinition of the built-in" errors for function related variables HOT 4
- enforce-slice-style: Add declaration style HOT 8
- False Positive in rule max-control-nesting HOT 3
- False positive datarace detection in Go 1.22 HOT 2
- var-naming rule can suggest invalid identifiers HOT 2
- comment-spacings exceptions do not work if there's no colon after the exception HOT 2
- Possible false positive confusing-naming error on generics with pointer type receiver HOT 2
- duplicate-imports linter broken? HOT 3
- out-of-order rules in documentation HOT 1
- Regressions related to 4242f24 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from revive.