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

add --names option #67

Merged
merged 1 commit into from
Feb 25, 2022
Merged

Conversation

Riyabelle25
Copy link
Contributor

@Riyabelle25 Riyabelle25 commented Feb 25, 2022

solves #50, by adding the --names option.

.option('names', {
			alias: 'n',
			default: false,
			describe: 'Shows the list of repo names with their owner',
			type: 'boolean',
		})

On setting true it outputs the list of repos-with-their owner instead of the repo-report table.
will remove the alias if it's not required here, or can come up with a more meaningful name for the option

cc: @ljharb

Copy link
Owner

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the const metrics = code can be moved down, to right above where the table is generated.

i then also wonder if maybe the code that gets, filters, and sorts repositories could live in a separate function that detail calls? and then, we could have repo-report --names call that directly instead of adding this to detail?

src/commands/detail.js Outdated Show resolved Hide resolved
src/commands/detail.js Outdated Show resolved Hide resolved
bin/repoArgs.js Outdated Show resolved Hide resolved
bin/repoArgs.js Outdated Show resolved Hide resolved
.gitignore Outdated Show resolved Hide resolved
src/commands/detail.js Outdated Show resolved Hide resolved
.gitignore Outdated Show resolved Hide resolved
@ljharb
Copy link
Owner

ljharb commented Feb 25, 2022

What do you think about #67 (review) ?

@Riyabelle25
Copy link
Contributor Author

I think it's o-kay for now.
Moving those functionalities to a separate utils file would defy the purpose of having detail.js, as it's most of the code from there (L105 - L122). It looks like it might complicate things for the sake of better modularity

@ljharb
Copy link
Owner

ljharb commented Feb 25, 2022

That's true that it's the bulk of the detail command - but the "generateDetailTable" call is really the point of that, getting repo names is incidental.

I'm happy to land this as-is, but I'll probably refactor it this way anyways :-)

@Riyabelle25
Copy link
Contributor Author

Aight. Perhaps I can open a separate issue addressing this once the current PR is merged?

@ljharb ljharb merged commit 8d97bd6 into ljharb:main Feb 25, 2022
@ljharb
Copy link
Owner

ljharb commented Feb 25, 2022

Turns out we already had repo-report ls, but it'd been broken at some point, so I moved this code into that separate (re-created) command :-)

@Riyabelle25
Copy link
Contributor Author

Woah! Just saw your refactored code 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants