New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SCM issue #75862
Comments
This seems like a user configuration issue, not related to VS Code. First, you should figure out what is the correct behavior in that case: should the linting fail or not? Then, you should try to figure out why it misbehaves in each case. VS Code simply spawns git.exe to commit, so you can inspect processes and see whether the linting task is called at all. |
Thanks for response. The correct behavior in this case: the linting should fail, because 001-sum.js doesn't pass tests. I found an interesting thing. While I manually run SCM commit outputhusky > pre-commit (node v10.16.0) 2019-06-24T18:36:02.859Z lint-staged:bin Running `lint-staged@8.1.5` 2019-06-24T18:36:03.424Z lint-staged:find-bin Loaded package.json using `process.cwd()` 2019-06-24T18:36:03.652Z lint-staged Loading config using `cosmiconfig` 2019-06-24T18:36:03.660Z lint-staged Successfully loaded config from `c:\Users\publi\js\js-problems\package.json`: { '*.js': [ 'jest --bail --findRelatedTests' ] } 2019-06-24T18:36:03.660Z lint-staged:cfg Normalizing config 2019-06-24T18:36:03.662Z lint-staged:cfg Validating config Running lint-staged with the following config: { linters: { '*.js': [ 'jest --bail --findRelatedTests' ] }, concurrent: true, chunkSize: 9007199254740991, globOptions: { matchBase: true, dot: true }, ignore: [], subTaskConcurrency: 1, renderer: 'verbose', relative: false } 2019-06-24T18:36:03.669Z lint-staged:run Running all linter scripts 2019-06-24T18:36:03.670Z lint-staged:run Resolved git directory to be `c:\Users\publi\js\js-problems` 2019-06-24T18:36:03.712Z lint-staged:run Loaded list of staged files in git: [ 'problems/001-sum.js' ] 2019-06-24T18:36:03.712Z lint-staged:gen-tasks Generating linter tasks 2019-06-24T18:36:03.712Z lint-staged:cfg Normalizing config 2019-06-24T18:36:03.720Z lint-staged:gen-tasks Generated task: { pattern: '*.js', commands: [ 'jest --bail --findRelatedTests' ], fileList: [ 'c:\\Users\\publi\\js\\js-problems\\problems\\001-sum.js' ] } Stashing changes... [started] Stashing changes... [skipped] → No partially staged files found... Running linters... [started] Running tasks for *.js [started] 2019-06-24T18:36:03.767Z lint-staged:make-cmd-tasks Creating listr tasks for commands [ 'jest --bail --findRelatedTests' ] 2019-06-24T18:36:03.768Z lint-staged:find-bin Resolving binary for command `jest --bail --findRelatedTests` 2019-06-24T18:36:03.774Z lint-staged:find-bin Binary for `jest --bail --findRelatedTests` resolved to `c:\Users\publi\js\js-problems\node_modules\.bin\jest.CMD` 2019-06-24T18:36:03.774Z lint-staged:task OS: win32; Creating linter task with 1 chunked file paths jest --bail --findRelatedTests [started] 2019-06-24T18:36:03.778Z lint-staged:task bin: c:\Users\publi\js\js-problems\node_modules\.bin\jest.CMD 2019-06-24T18:36:03.778Z lint-staged:task args: [ '--bail', '--findRelatedTests', 'c:\\Users\\publi\\js\\js-problems\\problems\\001-sum.js' ] 2019-06-24T18:36:03.778Z lint-staged:task opts: { reject: false } jest --bail --findRelatedTests [completed] Running tasks for *.js [completed] Running linters... [completed] 2019-06-24T18:36:04.854Z lint-staged linters were executed successfully! bash.exe outputhusky > pre-commit (node v10.16.0) lint-staged:bin Running `lint-staged@8.1.5` +0ms lint-staged:find-bin Loaded package.json using `process.cwd()` +0ms lint-staged Loading config using `cosmiconfig` +0ms lint-staged Successfully loaded config from `C:\Users\publi\js\js-problems\package.json`: lint-staged { '*.js': [ 'jest --bail --findRelatedTests' ] } +6ms lint-staged:cfg Normalizing config +0ms lint-staged:cfg Validating config +2ms Running lint-staged with the following config: { linters: { '*.js': [ 'jest --bail --findRelatedTests' ] }, concurrent: true, chunkSize: 9007199254740991, globOptions: { matchBase: true, dot: true }, ignore: [], subTaskConcurrency: 1, renderer: 'verbose', relative: false } lint-staged:run Running all linter scripts +0ms lint-staged:run Resolved git directory to be `C:\Users\publi\js\js-problems` +2ms lint-staged:run Loaded list of staged files in git: lint-staged:run [ 'problems/001-sum.js', 'package.json' ] +50ms lint-staged:gen-tasks Generating linter tasks +0ms lint-staged:cfg Normalizing config +59ms lint-staged:gen-tasks Generated task: lint-staged:gen-tasks { pattern: '*.js', lint-staged:gen-tasks commands: [ 'jest --bail --findRelatedTests' ], lint-staged:gen-tasks fileList: lint-staged:gen-tasks [ 'C:\\Users\\publi\\js\\js-problems\\problems\\001-sum.js' ] } +9ms Stashing changes... [started] Stashing changes... [skipped] → No partially staged files found... Running linters... [started] Running tasks for *.js [started] lint-staged:make-cmd-tasks Creating listr tasks for commands [ 'jest --bail --findRelatedTests' ] +0ms lint-staged:find-bin Resolving binary for command `jest --bail --findRelatedTests` +378ms lint-staged:find-bin Binary for `jest --bail --findRelatedTests` resolved to `C:\Users\publi\js\js-problems\node_modules\.bin\jest.CMD` +7ms lint-staged:task OS: win32; Creating linter task with 1 chunked file paths +0ms jest --bail --findRelatedTests [started] lint-staged:task bin: C:\Users\publi\js\js-problems\node_modules\.bin\jest.CMD +4ms lint-staged:task args: [ '--bail', lint-staged:task '--findRelatedTests', lint-staged:task 'C:\\Users\\publi\\js\\js-problems\\problems\\001-sum.js' ] +1ms lint-staged:task opts: { reject: false } +0ms jest --bail --findRelatedTests [failed] → Running tasks for *.js [failed] → Running linters... [failed] Could disk letter case depend on SCM or I should go to lint-staged repo with this issue? |
Let's try to figure out why jest can't find that file. In Windows paths are case insensitive. |
It looks like Jest has case sensitivity issues. Thank you for your assistance with this matter. |
Hey,
There is an interesting issue with SCM on Windows 10: commit from shell and SCM has different result. When I commit through shell it fails on running tests and it doesn't when I commit through SCM. On MacOS I can't reproduce this issue.
Steps to Reproduce:
npm i
to setup jest and husky.problems/001-sum.js
file and replaceundefined
with 1.git commit -am 'test'
in shell and it fails as expected001-sum.js
, write message and commit, but this won't fail and will be added to the repo.Does this issue occur when all extensions are disabled?: Yes
The text was updated successfully, but these errors were encountered: