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

feat(cli): add skip and only category filters #831

Merged
merged 3 commits into from
Oct 4, 2024

Conversation

hanna-skryl
Copy link
Collaborator

Closes #610 closes #611

This pull request adds two new CLI flags, --skipCategories and --onlyCategories, to extend the filtering capabilities of the CLI, allowing users to skip or execute only specific categories.

The existing filterPluginsMiddleware has been renamed to filterMiddleware as it now handles filtering for both plugins and categories in a unified manner. This ensures that all validation and filtering logic happens in the same place.

The user is notified about skipped or included categories in the same way as they are notified about skipped or included plugins, maintaining a consistent user experience across both filtering options.

@hanna-skryl hanna-skryl self-assigned this Oct 3, 2024
Copy link

github-actions bot commented Oct 3, 2024

Code PushUp

🤨 Code PushUp report has both improvements and regressions – compared target commit b278d14 with source commit 9d75682.

🕵️ See full comparison in Code PushUp portal 🔍

🏷️ Categories

🏷️ Category ⭐ Previous score ⭐ Current score 🔄 Score change
Performance 🟡 52 🔴 49 ↓ −2.8
Code coverage 🟢 90 🟢 90 ↑ +0.1
Custom checks 🟡 67 🟡 67
Security 🟡 87 🟡 87
Updates 🟡 78 🟡 78
Accessibility 🟢 91 🟢 91
Best Practices 🟢 100 🟢 100
SEO 🟡 61 🟡 61
Bug prevention 🟢 100 🟢 100
Code style 🟢 99 🟢 99
👍 1 group improved, 👎 1 group regressed, 👍 5 audits improved, 👎 3 audits regressed, 12 audits changed without impacting score

🗃️ Groups

🔌 Plugin 🗃️ Group ⭐ Previous score ⭐ Current score 🔄 Score change
Lighthouse Performance 🟡 52 🔴 49 ↓ −2.8
Code coverage Code coverage metrics 🟢 90 🟢 90 ↑ +0.1

18 other groups are unchanged.

🛡️ Audits

🔌 Plugin 🛡️ Audit 📏 Previous value 📏 Current value 🔄 Value change
Lighthouse Largest Contentful Paint 🟨 3.3 s 🟨 3.7 s ↑ +12.7 %
Lighthouse Speed Index 🟥 6.4 s 🟥 5.9 s ↓ −7.1 %
Lighthouse First Contentful Paint 🟨 2.8 s 🟨 3.0 s ↑ +6 %
Lighthouse First Meaningful Paint 🟨 2.8 s 🟨 3.0 s ↑ +6 %
Lighthouse Time to Interactive 🟥 17.3 s 🟥 15.7 s ↓ −9.3 %
Code coverage Function coverage 🟩 92.3 % 🟩 92.4 % ↑ +0.1 %
Code coverage Branch coverage 🟨 85.2 % 🟨 85.3 % ↑ +0.1 %
Code coverage Line coverage 🟩 91.5 % 🟩 91.5 % ↑ +0.1 %
Lighthouse Avoids enormous network payloads 🟩 Total size was 1,807 KiB 🟩 Total size was 1,815 KiB ↑ +0.4 %
Lighthouse Minimizes main-thread work 🟥 21.4 s 🟥 19.7 s ↓ −7.8 %
Lighthouse Metrics 🟩 100% 🟩 100% ↓ −9.3 %
Lighthouse JavaScript execution time 🟥 10.7 s 🟥 9.3 s ↓ −13.7 %
Lighthouse Total Blocking Time 🟥 7,580 ms 🟥 6,440 ms ↓ −15 %
Lighthouse Eliminate render-blocking resources 🟥 Potential savings of 370 ms 🟥 Potential savings of 1,310 ms ↑ +256.4 %
Lighthouse Uses efficient cache policy on static assets 🟨 27 resources found 🟨 27 resources found ↑ +0.1 %
Lighthouse Max Potential First Input Delay 🟥 2,550 ms 🟥 2,750 ms ↑ +7.6 %
Lighthouse Server Backend Latencies 🟩 170 ms 🟩 100 ms ↓ −44.6 %
Lighthouse Initial server response time was short 🟩 Root document took 410 ms 🟩 Root document took 400 ms ↓ −4 %
Lighthouse Avoids an excessive DOM size 🟥 2,243 elements 🟥 2,239 elements ↓ −0.2 %
Lighthouse Network Round Trip Times 🟩 20 ms 🟩 20 ms ↓ −5.2 %

493 other audits are unchanged.

@hanna-skryl hanna-skryl marked this pull request as ready for review October 4, 2024 00:37
@hanna-skryl hanna-skryl requested a review from matejchalk October 4, 2024 00:37
matejchalk
matejchalk previously approved these changes Oct 4, 2024
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.

I like that you generalized the {only|skip}{Plugins|Categories} options into a single implementation, nice work 👍

@hanna-skryl hanna-skryl merged commit 149f54b into main Oct 4, 2024
17 checks passed
@hanna-skryl hanna-skryl deleted the feat/filter-categories branch October 4, 2024 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add CLI flag --onlyCategories add CLI flag --skipCategories
2 participants