mirror of
https://github.com/fzipp/gocyclo.git
synced 2025-02-06 11:01:57 +00:00
cmd/gocyclo: remove meaningless -total and -total-short options
Fixes #47
This commit is contained in:
parent
f2d376029e
commit
62aa1f84d9
@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [0.6.0] - 2022-06-15
|
||||
### Changed
|
||||
- Breaking: remove meaningless `-total` and `-total-short` options
|
||||
|
||||
## [0.5.1] - 2022-04-06
|
||||
### Fixed
|
||||
- Don't skip directories `.` and `..`
|
||||
|
@ -51,8 +51,6 @@ Flags:
|
||||
-top N show the top N most complex functions only
|
||||
-avg, -avg-short show the average complexity over all functions;
|
||||
the short option prints the value without a label
|
||||
-total, -total-short show the total complexity for all functions;
|
||||
the short option prints the value without a label
|
||||
-ignore REGEX exclude files matching the given regular expression
|
||||
|
||||
The output fields for each line are:
|
||||
|
@ -16,8 +16,6 @@
|
||||
// -top N show the top N most complex functions only
|
||||
// -avg, -avg-short show the average complexity;
|
||||
// the short option prints the value without a label
|
||||
// -total, -total-short show the total complexity;
|
||||
// the short option prints the value without a label
|
||||
// -ignore REGEX exclude files matching the given regular expression
|
||||
//
|
||||
// The output fields for each line are:
|
||||
@ -44,8 +42,6 @@ Flags:
|
||||
-top N show the top N most complex functions only
|
||||
-avg, -avg-short show the average complexity over all functions;
|
||||
the short option prints the value without a label
|
||||
-total, -total-short show the total complexity for all functions;
|
||||
the short option prints the value without a label
|
||||
-ignore REGEX exclude files matching the given regular expression
|
||||
|
||||
The output fields for each line are:
|
||||
@ -57,8 +53,6 @@ func main() {
|
||||
top := flag.Int("top", -1, "show the top N most complex functions only")
|
||||
avg := flag.Bool("avg", false, "show the average complexity")
|
||||
avgShort := flag.Bool("avg-short", false, "show the average complexity without a label")
|
||||
total := flag.Bool("total", false, "show the total complexity")
|
||||
totalShort := flag.Bool("total-short", false, "show the total complexity without a label")
|
||||
ignore := flag.String("ignore", "", "exclude files matching the given regular expression")
|
||||
|
||||
log.SetFlags(0)
|
||||
@ -77,9 +71,6 @@ func main() {
|
||||
if *avg || *avgShort {
|
||||
printAverage(allStats, *avgShort)
|
||||
}
|
||||
if *total || *totalShort {
|
||||
printTotal(allStats, *totalShort)
|
||||
}
|
||||
|
||||
if *over > 0 && len(shownStats) > 0 {
|
||||
os.Exit(1)
|
||||
@ -110,13 +101,6 @@ func printAverage(s gocyclo.Stats, short bool) {
|
||||
fmt.Printf("%.3g\n", s.AverageComplexity())
|
||||
}
|
||||
|
||||
func printTotal(s gocyclo.Stats, short bool) {
|
||||
if !short {
|
||||
fmt.Print("Total: ")
|
||||
}
|
||||
fmt.Printf("%d\n", s.TotalComplexity())
|
||||
}
|
||||
|
||||
func usage() {
|
||||
_, _ = fmt.Fprint(os.Stderr, usageDoc)
|
||||
os.Exit(2)
|
||||
|
Loading…
x
Reference in New Issue
Block a user