Giter VIP home page Giter VIP logo

Comments (5)

iiroj avatar iiroj commented on September 26, 2024

Please post your debug logs by running lint-staged with the --debug flag. I don't have access to this environment so I can't really help unless I get the info produced here:

// read the path of the current directory relative to the top-level directory
// don't read the toplevel directly, it will lead to an posix conform path on non posix systems (cygwin)
const gitRel = normalizePath(await execGit(['rev-parse', '--show-prefix'], { cwd }))
const gitDir = normalizePath(determineGitDir(normalizePath(cwd), gitRel))
const gitConfigDir = normalizePath(await resolveGitConfigDir(gitDir))
debugLog('Resolved git directory to be `%s`', gitDir)
debugLog('Resolved git config directory to be `%s`', gitConfigDir)

from lint-staged.

a2425rdl avatar a2425rdl commented on September 26, 2024

Uploading SE_MCM.pdf…
https://github.com/lint-staged/lint-staged/blob/master/CHANGELOG.md

from lint-staged.

AnDanilova avatar AnDanilova commented on September 26, 2024

Please post your debug logs by running lint-staged with the --debug flag.

2024-06-07T20:29:26.167Z lint-staged:bin Running `[email protected]` on Node.js v20.14.0 (win32)
2024-06-07T20:29:26.168Z lint-staged:bin Options parsed from command-line: {
  allowEmpty: false,
  concurrent: true,
  configPath: undefined,
  cwd: undefined,
  debug: true,
  diff: undefined,
  diffFilter: undefined,
  maxArgLength: undefined,
  quiet: false,
  relative: false,
  shell: false,
  stash: true,
  hidePartiallyStaged: true,
  verbose: false
}
2024-06-07T20:29:26.170Z lint-staged:validateOptions Validating options...
2024-06-07T20:29:26.170Z lint-staged:validateOptions Validated options!
2024-06-07T20:29:26.170Z lint-staged Unset GIT_LITERAL_PATHSPECS (was `undefined`)
2024-06-07T20:29:26.171Z lint-staged:runAll Running all linter scripts...
2024-06-07T20:29:26.171Z lint-staged:runAll Using working directory `\\wsl.localhost\Ubuntu\home\***\apps\front-next`
2024-06-07T20:29:26.171Z lint-staged:resolveGitRepo Resolving git repo from `\\wsl.localhost\Ubuntu\home\***\apps\front-next`
2024-06-07T20:29:26.171Z lint-staged:resolveGitRepo Unset GIT_DIR (was `undefined`)
2024-06-07T20:29:26.171Z lint-staged:resolveGitRepo Unset GIT_WORK_TREE (was `undefined`)
2024-06-07T20:29:26.172Z lint-staged:execGit Running git command [ 'rev-parse', '--show-prefix' ]
2024-06-07T20:29:26.335Z lint-staged:resolveGitRepo Failed to resolve git repo with error: Error: ENOENT: no such file or directory, lstat '\\wsl.localhost\Ubuntu\wsl.localhost\Ubuntu\home\***\.git'
    at async Object.lstat (node:internal/fs/promises:1018:18)
    at async resolveGitConfigDir (file://wsl.localhost/Ubuntu/home/***/node_modules/lint-staged/lib/resolveGitRepo.js:19:17)
    at async resolveGitRepo (file://wsl.localhost/Ubuntu/home/***/node_modules/lint-staged/lib/resolveGitRepo.js:69:40)
    at async runAll (file://wsl.localhost/Ubuntu/home/***/node_modules/lint-staged/lib/runAll.js:97:36)
    at async lintStaged (file://wsl.localhost/Ubuntu/home/***/node_modules/lint-staged/lib/index.js:110:17)
    at async file://wsl.localhost/Ubuntu/home/***/node_modules/lint-staged/bin/lint-staged.js:146:18 {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'lstat',
  path: '\\\\wsl.localhost\\Ubuntu\\wsl.localhost\\Ubuntu\\home\\***\\.git'
}
× Current directory is not a git directory!
Done in 4s 405ms
husky - pre-commit script failed (code 1)

image

from lint-staged.

iiroj avatar iiroj commented on September 26, 2024

Hey, would you be willing to test the code in this PR locally? Since there's no build-step you can just directly edit the files in your project's node_modules/lint-staged/ directory: #1433

from lint-staged.

AnDanilova avatar AnDanilova commented on September 26, 2024

Yep, this error has gone, but I got new one after your fix, × Failed to get staged files!
I added some extra debug logs to point where git diff command is called and see that path is correct, so it should be some different problem.
I think you can close this issue with this fix, thanks!

from lint-staged.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.