Comments (3)
@viktorasm Thanks for the report. Should be easy to implement.
from go-mnd.
@valer-cara I solved this by using regexp patterns. In this way we're very flexible.
from go-mnd.
@tommy-muehle - do you have a suggestion for the approach?
I'm imagining passing a list of ignored functions using their "fully qualified" name, similar to errcheck. Eg:
-ignored-functions="(*github.com/aws/aws-sdk-go.Config).MaxRetries"
The downside with this approach is that there's no type resolution at the AST level, so one needs much more complex parsing of the package tree to allow resolving an AST node to it's full name.
Do you see a cheaper way of identifying these ignorables? (not sure if i'm way off here)
from go-mnd.
Related Issues (20)
- Operations inside return statements are not being detected. HOT 2
- Multiplicative 2 should not be considered a magic number
- Constants typecasted trigger magic number. HOT 2
- time duration not considered a magic number HOT 4
- Go modules v2 compatibility HOT 1
- Floating point one `1.0` should not be considered as magic number HOT 2
- Concurrent map read and map write
- The results seem to be random HOT 4
- Literals in type conversions in block declarations should be okay HOT 2
- add ignored files will ignore all files HOT 2
- Magic number in second function parameter not reported HOT 2
- Duplicated code HOT 1
- `strconv.FormatInt` or `strconv.FormatUint` and magic numbers ? HOT 9
- Go built-in functions are not recognized when excluding functions
- Fails to detect magic number when initialized as part of "if"
- Does not work with go 1.20+
- Multiplicating two numbers and a duration is not reported HOT 1
- Feature request: Nolint rule for special cases, e.g. base 2 numbers
- How are we supposed to ignore "chained" function calls using regex?
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 go-mnd.