← Back to Pull requests

use common npm abbreviations, fixes #435 #484

Open
bronson opened this pull request with 14 lines diff across 7 files
View on GitHub
bronson bronson commented on Dec 29, 2015 00:34 UTC
Author

Fixes #435

Also updated some tests to use the abbreviations where convenient.

Diff: 14 lines (+7 / -7) across 7 files Reviewer: bronson Review duration: 5745255m
All Vouch review confidence checks passed
Residual risk 0.12 = Change Risk (0.49) × (1 − Review Confidence (0.76)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.49 · 14 lines diff across 7 files
0.49
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.90 · 5 substantive comment(s)
0.90
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
76%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.162
Self Review self_review
0.140
Real PR Conversation Timeline
8 items
Alhadis Alhadis commented on code on Jul 06, 2016 09:50 UTC
Code Review
src/view.coffee:1
@@ -9,7 +9,7 @@ tree = require './tree'
 
 module.exports =
 class View extends Command
-  @commandNames: ['view', 'show']
+  @commandNames: ['view', 'show', 'v']

Shouldn't info be added as an alias?

Homebrew uses it, and I'm constantly getting info mixed up with show or view...

bronson bronson commented on Oct 14, 2016 22:40 UTC
Author

Ha, sure. Added @Alhadis's suggestion and rebased to master.

bronson bronson commented on Oct 14, 2016 22:48 UTC
Author

Alas, it looks like CI on master is broken. The failure isn't related to this patch.

joefitzgerald joefitzgerald commented on Jan 16, 2017 18:06 UTC
Contributor

I would much prefer that new specs are added for the abbreviations, rather than changing the existing command names (e.g. install > i). This will ensure there are not regressions for the full command names.

bronson bronson commented on Sep 04, 2017 21:47 UTC
Author
bronson bronson commented on Sep 04, 2017 22:39 UTC
Author

OK, the patch has been updated to just specify the abbreviations, not test them.

Agreed, it would be nice to have specs for the abbreviations. I don't see a way to do it that looks clean though... Best I came up with would be to write tests like this:

describe 'aliases for install', ->
  runs ->
    expect(apm.findCommand(['i'])).toBe Install

Which requires the following patch to apm-cli.coffee:

diff --git a/src/apm-cli.coffee b/src/apm-cli.coffee
index fde6865..ff0a647 100644
--- a/src/apm-cli.coffee
+++ b/src/apm-cli.coffee
@@ -154,7 +154,12 @@ getPythonVersion = (callback) ->
         version = version?.trim()
       callback(version)
 
+findCommand = (command) ->
+  commands[command]
+
 module.exports =
+  findCommand: findCommand
+
   run: (args, callback) ->
     config.setupApmRcFile()
     options = parseOptions(args)
@@ -203,7 +208,7 @@ module.exports =
         else
           showHelp(options)
         options.callback()
-      else if Command = commands[command]
+      else if Command = findCommand(command)
         new Command().run(options)
       else
         options.callback("Unrecognized command: #{command}")

Can finish doing that if you think it's worth it.

bronson bronson commented on code on Sep 04, 2017 23:49 UTC
Code Review
src/view.coffee:1
@@ -9,7 +9,7 @@ tree = require './tree'
 
 module.exports =
 class View extends Command
-  @commandNames: ['view', 'show']
+  @commandNames: ['view', 'show', 'v']

(more than a year later...)

Sounds good, included.

Reviewers
Assignees
bronson bronson
Labels
risk: low confidence: 76.4% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 49.0% (MEDIUM) · Higher = larger blast radius
49.0%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 76.4% · Lower = rushed or shallow review
76.4%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 11.6% · Safe to merge
11.6%
Repository