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

refactor: make categories optional in core config #437

Merged
merged 7 commits into from
Jan 31, 2024

Conversation

BioPhoton
Copy link
Collaborator

@BioPhoton BioPhoton commented Jan 27, 2024

Closes #407

I aimed for handling the optional categories only in the cli layer and maintained the existing data structure fully in reports. I just hide the sections for empty categories.

Follow-up by @Tlacenka:

  • I added tests for scoring and sorting reports.
  • I allowed passing both undefined and [] by configuring categories schema to allow empty array.
  • I reduced minimal mocks.
  • I typed categories as a non-optional property as soon as in the only plugins middleware.

@BioPhoton BioPhoton changed the title feat(model): make categories optional feat(model): make categories optional in core config Jan 27, 2024
@BioPhoton BioPhoton marked this pull request as ready for review January 27, 2024 10:52
@BioPhoton BioPhoton self-assigned this Jan 27, 2024
@BioPhoton BioPhoton changed the title feat(model): make categories optional in core config feat(cli): make categories optional in core config Jan 27, 2024
@Tlacenka Tlacenka self-requested a review January 28, 2024 22:31
Copy link
Collaborator

@matejchalk matejchalk left a comment

Choose a reason for hiding this comment

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

We could also consider having some prompt to create categories in place of the missing category sections in report.md or stdout summary 🤔 But that's a different discussion and out of scope of this PR, I believe.

packages/cli/src/lib/implementation/only-plugins.utils.ts Outdated Show resolved Hide resolved
packages/cli/src/lib/collect/collect-command.ts Outdated Show resolved Hide resolved
packages/cli/README.md Outdated Show resolved Hide resolved
packages/utils/src/lib/reports/generate-stdout-summary.ts Outdated Show resolved Hide resolved
packages/utils/src/lib/reports/generate-md-report.ts Outdated Show resolved Hide resolved
@BioPhoton BioPhoton assigned Tlacenka and unassigned BioPhoton Jan 30, 2024
@Tlacenka Tlacenka marked this pull request as draft January 30, 2024 15:29
@Tlacenka
Copy link
Collaborator

We could also consider having some prompt to create categories in place of the missing category sections in report.md or stdout summary 🤔

@matejchalk
While we log a suggestion, that could get lost in the history. So I agree that having that prompt in the report itself would make sure that people know this option exists and where to find more info about it. Can you create an issue for this, please?

@Tlacenka Tlacenka changed the title feat(cli): make categories optional in core config refactor: make categories optional in core config Jan 30, 2024
packages/cli/README.md Outdated Show resolved Hide resolved
@Tlacenka Tlacenka marked this pull request as ready for review January 30, 2024 16:02
@Tlacenka Tlacenka removed their request for review January 30, 2024 16:02
@matejchalk
Copy link
Collaborator

While we log a suggestion, that could get lost in the history. So I agree that having that prompt in the report itself would make sure that people know this option exists and where to find more info about it. Can you create an issue for this, please?

Done ✔️

matejchalk
matejchalk previously approved these changes Jan 30, 2024
Copy link
Collaborator Author

@BioPhoton BioPhoton left a comment

Choose a reason for hiding this comment

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

You could update the snippets in 'docs/custom-plugind.md'

@Tlacenka Tlacenka merged commit d6cebb2 into main Jan 31, 2024
18 checks passed
@Tlacenka Tlacenka deleted the make-categories-optional branch January 31, 2024 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make categories optional
3 participants