Skip to content

Commit 3833442

Browse files
test, lib: fix spelling errors, minor changes
swap args and name in find-python. reason in comment add ".js" to couple imports due to import errors
1 parent 70dced1 commit 3833442

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

lib/find-python.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function colorizeOutput (color, string) {
6464
return color + string + RESET
6565
}
6666

67-
//! on windows debug running with locale cmd (e. g. chcp 866) encoding
67+
//! on windows debug running with locale cmd encoding (e. g. chcp 866)
6868
// to avoid that uncomment next lines
6969
// locale encodings cause issues. See run func for more info
7070
// this lines only for testing
@@ -312,7 +312,8 @@ class PythonFinder {
312312
this.log.verbose(
313313
`executing "${colorizeOutput(
314314
GREEN,
315-
check.name || check.arg
315+
// DONE: swap in favor of arg (user want to see what we actually will run not how it is named)
316+
check.arg || check.name
316317
)}" to get Python executable path`
317318
)
318319

@@ -469,6 +470,7 @@ class PythonFinder {
469470
`${colorizeOutput(GREEN, 'execFile')}: args = %j`,
470471
args
471472
)
473+
// TODO: make beauty print of PATH property (new line by semicolon)
472474
this.log.silly('execFile: opts = ', JSON.stringify(opts, null, 2))
473475

474476
//* possible outcomes with error messages on Windows (err.message, error.stack?, stderr)
@@ -504,6 +506,7 @@ class PythonFinder {
504506
`${colorizeOutput(RED, 'execFile result')}: err =`,
505507
(err && err.stack) || err
506508
)
509+
// TODO: add silly logs as in previous version
507510

508511
// executed script shouldn't pass anything to stderr if successful
509512
if (err || stderr) {
@@ -645,8 +648,8 @@ function findPython (configPython, callback) {
645648
/* findPython(null, (err, found) => {
646649
console.log('found:', '\x1b[31m', found)
647650
console.log('\x1b[0m')
648-
})
649-
*/
651+
})
652+
*/
650653
module.exports = findPython
651654
module.exports.test = {
652655
PythonFinder: PythonFinder,

test/test-configure-python.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const path = require('path')
55
const devDir = require('./common').devDir()
66
const gyp = require('../lib/node-gyp')
77
const requireInject = require('require-inject')
8-
const configure = requireInject('../lib/configure', {
8+
const configure = requireInject('../lib/configure.js', {
99
'graceful-fs': {
1010
openSync: function () { return 0 },
1111
closeSync: function () { },

test/test-find-accessible-sync.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
const test = require('tap').test
44
const path = require('path')
55
const requireInject = require('require-inject')
6-
const configure = requireInject('../lib/configure', {
6+
const configure = requireInject('../lib/configure.js', {
77
'graceful-fs': {
88
closeSync: function () { return undefined },
99
openSync: function (path) {

test/test-find-python.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ test('new-find-python', { buffered: true }, (t) => {
9595
const pythonFinderInstance = new PythonFinder(null, (err, path) => {
9696
if (err) {
9797
t.fail(
98-
`musn't produce any errors if execFile doesn't produced error. ${err}`
98+
`mustn't produce any errors if execFile doesn't produced error. ${err}`
9999
)
100100
} else {
101101
t.strictEqual(path, testString)

0 commit comments

Comments
 (0)