repo-analyzer https://github.com/pvaass/repo-analyzer
platform, _ := getPlatforms().ForURI("https://github.com/pvaass/repo-analyzer")
repository := repository.New(platform, "https://github.com/pvaass/repo-analyzer")
rules := detector.GetRules('/path/to/my/rules')
var results []detectors.Result := analyze.Run(repository, rules)
// type Result struct {
// Identifier string
// Score int
// }
You can create your own rules by placing a *.json
file in the rules/
directory.
Supported strategies are:
-
file-exist
:- Will return a score of 100 when any of the files in the argument list are found
- args: ["file-1", "file-2", ...]
-
composer#d
:- Will return a score of 100 when the first argument is found as a composer.json dependency
"args": [ "symfony/symfony" // Dependency to find ]
-
composer#f
:- Will return a score of 100 when the requested field matches the value in composer.json
"args": [ "name" //field name, "symfony/symfony" //value ]
- Supported field names:
name
-
npm#d
:- Will return a score of 100 when the first argument is found as a npm (package.json) dependency
"args": [ "react" // Dependency to find ]