nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: istanbuljs/nyc
Pull request #1057 (2019-04-05 00:03:11)

fix: set processinfo pid/ppid to actual numbers
As of Node.js v6, process.ppid is available, and a number.  So, there's
no need to pass the parent PID through the environment, which casts it
to a string.

coreyfarrell: Note for when this merges: We should tag the squashed commit as a `BREAKING CHANGE` since this changes the data type of the pid/ppid fields in processinfo files.
coveralls: 
[![Coverage Status](https://coveralls.io/builds/22637914/badge)](https://coveralls.io/builds/22637914)

Coverage decreased (-0.01%) to 96.324% when pulling **32e2a108dfcb871b73d0766b1d1ee54cf8f087e4 on isaacs:processinfo-numeric-pid** into **16d43155f62ca9caf95571930045ede6469d72ea on istanbuljs:master**.


Patch:
diff --git a/bin/wrap.js b/bin/wrap.js
index b4c9161..cc01d23 100644
--- a/bin/wrap.js
+++ b/bin/wrap.js
@@ -1,15 +1,13 @@
 var sw = require('spawn-wrap')
 var NYC = require('../index.js')
 
-var parentPid = process.env.NYC_PARENT_PID || '0'
-process.env.NYC_PARENT_PID = process.pid
-
 var config = {}
 if (process.env.NYC_CONFIG) config = JSON.parse(process.env.NYC_CONFIG)
 config.isChildProcess = true
 
 config._processInfo = {
-  ppid: parentPid,
+  pid: process.pid,
+  ppid: process.ppid,
   root: process.env.NYC_ROOT_ID
 }
 


Test patch:
diff --git a/test/nyc-integration.js b/test/nyc-integration.js
index 999e510..53527ff 100644
--- a/test/nyc-integration.js
+++ b/test/nyc-integration.js
@@ -1127,7 +1127,13 @@ describe('the nyc cli', function () {
       proc.on('close', function (code) {
         code.should.equal(0)
         stdout.should.not.match(new RegExp('└─'))
-        fs.statSync(path.resolve(fixturesCLI, '.nyc_output', 'processinfo'))
+        const dir = path.resolve(fixturesCLI, '.nyc_output', 'processinfo')
+        fs.statSync(dir)
+        // make sure that the processinfo file has a numeric pid and ppid
+        const files = fs.readdirSync(dir).filter(f => f !== 'index.json')
+        const data = JSON.parse(fs.readFileSync(dir + '/' + files[0], 'utf8'))
+        data.pid.should.be.a('number')
+        data.ppid.should.be.a('number')
         done()
       })
     })
Repository: istanbuljs/nyc
Pull request #1070 (2019-04-17 13:43:56)

fix: Exit with code 1 when nyc doesn't know what to do.
When nyc is not told to do anything this is an error.  We already
printed the help message to stderr, now we exit with code 1 to indicate
that nyc exited without doing anything.

Add a test to cover this edge case and verify that both `nyc` and `nyc
--help` produce output as expected to stdout and stderr, exit with the
proper code.

coveralls: 
[![Coverage Status](https://coveralls.io/builds/22869601/badge)](https://coveralls.io/builds/22869601)

Coverage increased (+0.2%) to 96.839% when pulling **9029c20247036d4f904e7de25c53d4f97ad26b0d on coreyfarrell:unknown-main-command** into **ca37ffa74c146b77c5fa9dc3411901e96e8c3a17 on istanbuljs:master**.


Patch:
diff --git a/bin/nyc.js b/bin/nyc.js
index cd22584..7c188e4 100755
--- a/bin/nyc.js
+++ b/bin/nyc.js
@@ -85,5 +85,6 @@ if ([
   })
 } else {
   // I don't have a clue what you're doing.
+  process.exitCode = 1
   yargs.showHelp()
 }


Test patch:
diff --git a/test/nyc-integration.js b/test/nyc-integration.js
index 91bd358..903f78d 100644
--- a/test/nyc-integration.js
+++ b/test/nyc-integration.js
@@ -12,7 +12,7 @@ const glob = require('glob')
 const isWindows = require('is-windows')()
 const rimraf = require('rimraf')
 const makeDir = require('make-dir')
-const spawn = require('child_process').spawn
+const { spawn, spawnSync } = require('child_process')
 const si = require('strip-indent')
 
 require('chai').should()
@@ -1079,6 +1079,23 @@ describe('the nyc cli', function () {
     })
   })
 
+  it('help shows to stderr when main command doesn\'t know what to do', () => {
+    const opts = {
+      cwd: fixturesCLI,
+      env,
+      encoding: 'utf8'
+    }
+
+    const help = spawnSync(process.execPath, [bin, '--help'], opts)
+    const unknown = spawnSync(process.execPath, [bin], opts)
+    help.status.should.equal(0)
+    unknown.status.should.equal(1)
+    help.stderr.should.equal('')
+    unknown.stdout.should.equal('')
+    help.stdout.should.not.equal('')
+    help.stdout.should.equal(unknown.stderr)
+  })
+
   describe('args', function () {
     it('does not interpret args intended for instrumented bin', function (done) {
       var args = [bin, '--silent', process.execPath, 'args.js', '--help', '--version']