Add a --reset-baseline flag

Open Beginner friendly
#13 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Quiet
Tech stack
javascript
Domain
cli

Research direction

Start in bin/lockcheck.js and trace the existing argument handling and snapshot-path resolution. Verify the --reset-baseline path checks for .lockcheck-snapshot.json, deletes it when present, prints the specified success message, and exits immediately with code 0.

Written by the indexing model from the issue text.

Description

enhancement good first issue

Currently, lockcheck saves the initial scan of dependencies to a .lockcheck-snapshot.json file to use as a baseline for future diffs. If developers want to reset this baseline (say, after a massive version upgrade), they have to manually delete the file using rm .lockcheck-snapshot.json.

We should add a quick CLI flag to do this automatically.

Acceptance Criteria:

  • Add --reset-baseline as an allowed argument in bin/lockcheck.js.
  • If the flag is passed, check if resolve(dir, '.lockcheck-snapshot.json') exists using fs.existsSync.
  • If it exists, delete it using fs.unlinkSync().
  • Print a beautiful green success message Baseline snapshot deleted. The next run will create a new baseline. and immediately process.exit(0).
Dominant language
JavaScript
Stars
11
Forks
4
Avg merge
1d 17h
Merged PRs (30d)
3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from DhanushNehru/lockcheck

All issues in DhanushNehru/lockcheck

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.