Flamalyzer is a vet-like tool which detects common errors in Flamingo projects.
go install flamingo.me/flamalyzer@latest
Flamalyzer [FLAGS] [PATH]
There are different Flags which can be passed, if no Flags given the Flamalyzer will run in default mode.
--configFolder=[PATH]
To define the path to your config-files, the default is ./.flamalyzer
--configSuffix=[SUFFIX]
To define a string which must occur in the config-files name which should be loaded (useful if you have different files for different use-cases)
--debugFlamalyzer
To enable more information about what's going on in the program. Like info if the given configFolder-Path isn't configured properly.
go vet -vettool=$(which flamalyzer) [PATH]
Flamalyzer can be used as external filewatcher to enable error-highlighting in the IDE. Flamalyzer's output matches exactly vet's output, so the filewatcher configuration from vet can be used.
This analysis checks that an inject-function has a pointer-receiver
This analysis checks that an instance implements the interface it is bound to.
This analysis checks if the inject tags are used properly.
"inject tags" should be used for annotated injections only (e.g. config), otherwise inject method should be used.
This means:
- No empty inject tags
- Inject tags can be defined in the Inject-Function or must be referenced if defined outside
- They must be declared in the same package as the Inject-Function
This analysis checks all import statements below the entry path that the provided Group-Conventions are respected.
Configuration example:
entrypaths: ["src/architecture"]
groups:
infrastructure: ["infrastructure", "interfaces", "application", "domain"]
interfaces: ["interfaces", "application", "domain"]
application: ["application", "domain"]
domain: ["domain"]
The Configuration is done via yaml-files.
The files are expected in ./.flamalyzer
The directory can be specified by --configFolder=[PATH]
config.yaml example:
# Config of the Dingo-Analyzer
dingoAnalyzer:
checkPointerReceiver: false
checkStrictTagsAndFunctions: false
checkCorrectInterfaceToInstanceBinding: false
# Config of the DependencyConventions-Analyzer
architectureAnalyzer:
entryPaths: []
checkDependencyConventions: true
groups:
infrastructure: ["infrastructure", "interfaces", "application", "domain"]
interfaces: ["interfaces", "application", "domain"]
application: ["application", "domain"]
domain: ["domain"]
There is the possibility to filter the files which should be read in.
Use --configSuffix=[SUFFIX]
to pass a string which must be part of config-file name.