Repository navigation
fix(cli): credit inline useLogger().set() and grade an empty scan as unscored - #822
Merged
Merged
Conversation
…unscored
evlog map missed log.set() when it was called straight on the factory call, e.g. useLogger(event).set({ … }), because the chain has no root identifier. Those calls are now credited when the factory resolves to evlog.
A project with no entry points to score reported a free 100 graded excellent, and --min-score passed it. It is now graded unscored (nothing to scan), and --min-score exits 1 in that case. The numeric score is unchanged.
Regression tests come first in the rules, score and command suites. Changeset: @evlog/cli patch.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Contributor
|
Thank you for following the naming conventions! 🙏 |
@evlog/cli
evlog
@evlog/nuxthub
@evlog/signals
@evlog/telemetry
commit: |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes two
evlog mapresults reported in EVL-535.1. Inline
useLogger(event).set()was reported as missinglog.set(). The call's chain hangs on theuseLogger(event)call, which has no root identifier, sologgerCalls('set')never credited it.CallFactnow carries the factory name (factory), and a call counts when that factory resolves to evlog. A localuseLoggerstub is still not credited.2. A project with no entry points scored a free 100, "excellent", and passed
--min-score. It is now gradedunscored("nothing to scan"). The numeric score is unchanged (Option A from the issue).--min-scorecannot pass an unscored run, so it exits 1. The gate is one helper,passesMinScore, shared by the exit code, the human gate line, and the GitHub annotation.Before/after was reproduced with the built CLI from this branch against small fixtures.
Before (
evlog0.9.0 from npm, the build I could run first):After (built from
e9f0210):Verification
setinrules.test.ts,passesMinScoreinscore.test.ts, empty-project grade and gate inmap.command.test.ts.pnpm run lint: passes.tsc --noEmitforpackages/cli: passes.vitest runinpackages/cli: 31 files pass.pnpm run buildinpackages/cli: passes.Caveats
@evlog/cli@9a6ed6e. I reproduced on 0.9.0, so exact before-numbers may differ on that build.useLogger(event).audit(...)now goes through the same credit path. I did not add a dedicated test for it.Refs EVL-535
ELI5
evlog maphad two wrong answers. First, it missed a logger call when the code wrote the call directly afteruseLogger(event), without storing the logger in a variable first. Now it counts those calls. Second, a project with nothing to check got a perfect score and passed the CI gate. Now it says "nothing to scan" and the gate fails, because there is nothing to pass.