Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support maximum years of inactivity option #16

Merged
merged 1 commit into from
Oct 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion cmd/diagnose.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ type Options struct {
packageManager string
lockFilePath string
ignores string
year int
}

func (o *Options) Ignores() []string {
Expand Down Expand Up @@ -91,7 +92,7 @@ var diagnoseCmd = &cobra.Command{
}

department := NewDepartment(doctor)
diagnoses := department.Diagnose(f, MAX_YEAR_TO_BE_BLANK, o.Ignores())
diagnoses := department.Diagnose(f, o.year, o.Ignores())
if err := Report(diagnoses); err != nil {
os.Exit(1)
}
Expand All @@ -103,6 +104,7 @@ func init() {
diagnoseCmd.Flags().StringVarP(&o.packageManager, "package", "p", "bundler", "package manager")
diagnoseCmd.Flags().StringVarP(&o.lockFilePath, "lock_file", "f", "Gemfile.lock", "lock file path")
diagnoseCmd.Flags().StringVarP(&o.ignores, "ignores", "i", "", "ignore dependencies")
diagnoseCmd.Flags().IntVarP(&o.year, "year", "y", MAX_YEAR_TO_BE_BLANK, "max years of inactivity")
}

func Report(diagnoses map[string]Diagnosis) error {
Expand Down
Loading