Skip to content

Commit e493acd

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 54cc1de commit e493acd

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
@@ -32,7 +32,7 @@ function colorizeOutput (color, string) {
3232
return color + string + RESET
3333
}
3434

35-
//! on windows debug running with locale cmd (e. g. chcp 866) encoding
35+
//! on windows debug running with locale cmd encoding (e. g. chcp 866)
3636
// to avoid that uncomment next lines
3737
// locale encodings cause issues. See run func for more info
3838
// this lines only for testing
@@ -284,7 +284,8 @@ class PythonFinder {
284284
this.log.verbose(
285285
`executing "${colorizeOutput(
286286
GREEN,
287-
check.name || check.arg
287+
// DONE: swap in favor of arg (user want to see what we actually will run not how it is named)
288+
check.arg || check.name
288289
)}" to get Python executable path`
289290
)
290291

@@ -441,6 +442,7 @@ class PythonFinder {
441442
`${colorizeOutput(GREEN, 'execFile')}: args = %j`,
442443
args
443444
)
445+
// TODO: make beauty print of PATH property (new line by semicolon)
444446
this.log.silly('execFile: opts = ', JSON.stringify(opts, null, 2))
445447

446448
//* possible outcomes with error messages on Windows (err.message, error.stack?, stderr)
@@ -476,6 +478,7 @@ class PythonFinder {
476478
`${colorizeOutput(RED, 'execFile result')}: err =`,
477479
(err && err.stack) || err
478480
)
481+
// TODO: add silly logs as in previous version
479482

480483
// executed script shouldn't pass anything to stderr if successful
481484
if (err || stderr) {
@@ -617,8 +620,8 @@ function findPython (configPython, callback) {
617620
/* findPython(null, (err, found) => {
618621
console.log('found:', '\x1b[31m', found)
619622
console.log('\x1b[0m')
620-
})
621-
*/
623+
})
624+
*/
622625
module.exports = findPython
623626
module.exports.test = {
624627
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)