Skip to content
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

There is a bug with bracketed folders #1377

Open
arslonbekXX opened this issue Dec 14, 2023 · 5 comments
Open

There is a bug with bracketed folders #1377

arslonbekXX opened this issue Dec 14, 2023 · 5 comments

Comments

@arslonbekXX
Copy link

Description

CleanShot 2023-12-14 at 14 50 05@2x

CleanShot 2023-12-14 at 14 49 47@2x

  • OS: macOS Sonoma
  • Node.js: 20.10.0
  • lint-staged: 15.2.0
@iiroj
Copy link
Member

iiroj commented Dec 14, 2023

What's your lint-staged config, are you using the --shell flag, and can you post the logs you get when using the --debug flag?

@arslonbekXX
Copy link
Author

lint-staged:bin Running lint-staged@15.2.0 on Node.js v20.10.0 (darwin) +0ms
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
} +0ms
lint-staged:validateOptions Validating options... +0ms
lint-staged:validateOptions Validated options! +0ms
lint-staged Unset GIT_LITERAL_PATHSPECS (was undefined) +0ms
lint-staged:runAll Running all linter scripts... +0ms
lint-staged:runAll Using working directory /Users/arslonbekalimbayev/projects/comfi/merchant-dashboard.2.0 +0ms
lint-staged:resolveGitRepo Resolving git repo from /Users/arslonbekalimbayev/projects/comfi/merchant-dashboard.2.0 +0ms
lint-staged:resolveGitRepo Unset GIT_DIR (was undefined) +0ms
lint-staged:resolveGitRepo Unset GIT_WORK_TREE (was undefined) +0ms
lint-staged:execGit Running git command [ 'rev-parse', '--show-prefix' ] +0ms
lint-staged:resolveGitRepo Resolved git directory to be /Users/arslonbekalimbayev/projects/comfi/merchant-dashboard.2.0 +7ms
lint-staged:resolveGitRepo Resolved git config directory to be /Users/arslonbekalimbayev/projects/comfi/merchant-dashboard.2.0/.git +0ms
lint-staged:execGit Running git command [ 'log', '-1' ] +6ms
lint-staged:execGit Running git command [ 'diff', '--name-only', '-z', '--diff-filter=ACMR', '--staged' ] +6ms
lint-staged:runAll Loaded list of staged files in git:
lint-staged:runAll [
lint-staged:runAll '/Users/arslonbekalimbayev/projects/comfi/merchant-dashboard.2.0/.husky/pre-commit',
lint-staged:runAll '/Users/arslonbekalimbayev/projects/comfi/merchant-dashboard.2.0/src/app/(auth)/layout.tsx'
lint-staged:runAll ] +22ms
lint-staged:searchConfigs Searching for configuration files... +0ms
lint-staged:execGit Running git command [ 'ls-files', '-z', '--full-name' ] +9ms
lint-staged:execGit Running git command [ 'ls-files', '-z', '--full-name', '--others', '--exclude-standard' ] +1ms
lint-staged:searchConfigs Found possible config files: [
'/Users/arslonbekalimbayev/projects/comfi/merchant-dashboard.2.0/.lintstagedrc.json',
'/Users/arslonbekalimbayev/projects/comfi/merchant-dashboard.2.0/package.json'
] +6ms
lint-staged:loadConfig Loading configuration from /Users/arslonbekalimbayev/projects/comfi/merchant-dashboard.2.0/.lintstagedrc.json... +0ms
lint-staged:loadConfig Loading configuration from /Users/arslonbekalimbayev/projects/comfi/merchant-dashboard.2.0/package.json... +0ms
lint-staged:loadConfig Successfully loaded config from /Users/arslonbekalimbayev/projects/comfi/merchant-dashboard.2.0/package.json:
lint-staged:loadConfig null +0ms
lint-staged:loadConfig Successfully loaded config from /Users/arslonbekalimbayev/projects/comfi/merchant-dashboard.2.0/.lintstagedrc.json:
lint-staged:loadConfig {
lint-staged:loadConfig '/*.scss': [ 'bun format', 'bun stylelint' ],
lint-staged:loadConfig '
/.{js,jsx,ts,tsx}': [ 'bun format', 'bun lint:fix' ],
lint-staged:loadConfig '**/
.{json,ts,tsx,js,jsx,md,scss,html}': [ 'bun format' ]
lint-staged:loadConfig } +0ms
lint-staged:validateConfig Validating config from /Users/arslonbekalimbayev/projects/comfi/merchant-dashboard.2.0/.lintstagedrc.json... +0ms
lint-staged:validateConfig Validated config from /Users/arslonbekalimbayev/projects/comfi/merchant-dashboard.2.0/.lintstagedrc.json: +0ms
lint-staged:validateConfig {
lint-staged:validateConfig '/*.scss': [
lint-staged:validateConfig 'bun format',
lint-staged:validateConfig 'bun stylelint'
lint-staged:validateConfig ],
lint-staged:validateConfig '
/.{js,jsx,ts,tsx}': [
lint-staged:validateConfig 'bun format',
lint-staged:validateConfig 'bun lint:fix'
lint-staged:validateConfig ],
lint-staged:validateConfig '**/
.{json,ts,tsx,js,jsx,md,scss,html}': [
lint-staged:validateConfig 'bun format'
lint-staged:validateConfig ]
lint-staged:validateConfig } +1ms
lint-staged:searchConfigs Found 1 config files +2ms
lint-staged:groupFilesByConfig Grouping 2 files by 1 configurations +0ms
lint-staged:chunkFiles Resolved an argument string length of 171 characters from 2 files +0ms
lint-staged:chunkFiles Creating 1 chunks for maxArgLength of 131072 +0ms
lint-staged:generateTasks Generating linter tasks +0ms
lint-staged:generateTasks Generated task:
lint-staged:generateTasks {
lint-staged:generateTasks pattern: '/*.scss',
lint-staged:generateTasks commands: [ 'bun format', 'bun stylelint' ],
lint-staged:generateTasks fileList: []
lint-staged:generateTasks } +1ms
lint-staged:generateTasks Generated task:
lint-staged:generateTasks {
lint-staged:generateTasks pattern: '
/.{js,jsx,ts,tsx}',
lint-staged:generateTasks commands: [ 'bun format', 'bun lint:fix' ],
lint-staged:generateTasks fileList: [
lint-staged:generateTasks '/Users/arslonbekalimbayev/projects/comfi/merchant-dashboard.2.0/src/app/(auth)/layout.tsx'
lint-staged:generateTasks ]
lint-staged:generateTasks } +1ms
lint-staged:generateTasks Generated task:
lint-staged:generateTasks {
lint-staged:generateTasks pattern: '**/
.{json,ts,tsx,js,jsx,md,scss,html}',
lint-staged:generateTasks commands: [ 'bun format' ],
lint-staged:generateTasks fileList: [
lint-staged:generateTasks '/Users/arslonbekalimbayev/projects/comfi/merchant-dashboard.2.0/src/app/(auth)/layout.tsx'
lint-staged:generateTasks ]
lint-staged:generateTasks } +0ms
lint-staged:makeCmdTasks Creating listr tasks for commands [ 'bun format', 'bun stylelint' ] +0ms
lint-staged:resolveTaskFn cmd: bun +0ms
lint-staged:resolveTaskFn args: [ 'format' ] +0ms
lint-staged:resolveTaskFn execaOptions: {
cwd: '/Users/arslonbekalimbayev/projects/comfi/merchant-dashboard.2.0',
preferLocal: true,
reject: false,
shell: false
} +0ms
lint-staged:resolveTaskFn cmd: bun +0ms
lint-staged:resolveTaskFn args: [ 'stylelint' ] +0ms
lint-staged:resolveTaskFn execaOptions: {
cwd: '/Users/arslonbekalimbayev/projects/comfi/merchant-dashboard.2.0',
preferLocal: true,
reject: false,
shell: false
} +0ms
lint-staged:makeCmdTasks Creating listr tasks for commands [ 'bun format', 'bun lint:fix' ] +1ms
lint-staged:resolveTaskFn cmd: bun +0ms
lint-staged:resolveTaskFn args: [ 'format' ] +0ms
lint-staged:resolveTaskFn execaOptions: {
cwd: '/Users/arslonbekalimbayev/projects/comfi/merchant-dashboard.2.0',
preferLocal: true,
reject: false,
shell: false
} +0ms
lint-staged:resolveTaskFn cmd: bun +0ms
lint-staged:resolveTaskFn args: [ 'lint:fix' ] +0ms
lint-staged:resolveTaskFn execaOptions: {
cwd: '/Users/arslonbekalimbayev/projects/comfi/merchant-dashboard.2.0',
preferLocal: true,
reject: false,
shell: false
} +0ms
lint-staged:makeCmdTasks Creating listr tasks for commands [ 'bun format' ] +0ms
lint-staged:resolveTaskFn cmd: bun +0ms
lint-staged:resolveTaskFn args: [ 'format' ] +0ms
lint-staged:resolveTaskFn execaOptions: {
cwd: '/Users/arslonbekalimbayev/projects/comfi/merchant-dashboard.2.0',
preferLocal: true,
reject: false,
shell: false
} +0ms
lint-staged:chunkFiles Resolved an argument string length of 89 characters from 1 files +3ms
lint-staged:chunkFiles Creating 1 chunks for maxArgLength of 131072 +0ms
[STARTED] Preparing lint-staged...
lint-staged:GitWorkflow Backing up original state... +0ms
lint-staged:GitWorkflow Getting partially staged files... +0ms
lint-staged:execGit Running git command [ 'status', '-z' ] +11ms
lint-staged:GitWorkflow Found partially staged files: [] +6ms
lint-staged:GitWorkflow Backing up merge state... +1ms
lint-staged:file Reading file /Users/arslonbekalimbayev/projects/comfi/merchant-dashboard.2.0/.git/MERGE_HEAD +0ms
lint-staged:file Reading file /Users/arslonbekalimbayev/projects/comfi/merchant-dashboard.2.0/.git/MERGE_MODE +0ms
lint-staged:file Reading file /Users/arslonbekalimbayev/projects/comfi/merchant-dashboard.2.0/.git/MERGE_MSG +0ms
lint-staged:file File /Users/arslonbekalimbayev/projects/comfi/merchant-dashboard.2.0/.git/MERGE_HEAD doesn't exist, ignoring... +0ms
lint-staged:file File /Users/arslonbekalimbayev/projects/comfi/merchant-dashboard.2.0/.git/MERGE_MSG doesn't exist, ignoring... +0ms
lint-staged:file File /Users/arslonbekalimbayev/projects/comfi/merchant-dashboard.2.0/.git/MERGE_MODE doesn't exist, ignoring... +0ms
lint-staged:GitWorkflow Done backing up merge state! +0ms
lint-staged:GitWorkflow Getting deleted files... +0ms
lint-staged:execGit Running git command [ 'ls-files', '--deleted' ] +7ms
lint-staged:GitWorkflow Found deleted files: [] +5ms
lint-staged:execGit Running git command [ 'stash', 'create' ] +5ms
lint-staged:execGit Running git command [
'stash',
'store',
'--quiet',
'--message',
'lint-staged automatic backup',
'7914da567dde72b94b8bd02e85832033430d7e64'
] +14ms
lint-staged:GitWorkflow Done backing up original state! +20ms
[COMPLETED] Preparing lint-staged...
[STARTED] Running tasks for staged files...
[STARTED] .lintstagedrc.json — 2 files
[STARTED] **/.scss — 0 files
[STARTED] **/
.{js,jsx,ts,tsx} — 1 file
[STARTED] **/.{json,ts,tsx,js,jsx,md,scss,html} — 1 file
[SKIPPED] **/
.scss — no files
[STARTED] bun format
[STARTED] bun format
[FAILED] bun format [FAILED]
[FAILED] bun format [FAILED]
[COMPLETED] Running tasks for staged files...
[STARTED] Applying modifications from tasks...
[SKIPPED] Skipped because of errors from tasks.
[STARTED] Reverting to original state because of errors...
lint-staged:GitWorkflow Restoring original state... +12ms
lint-staged:execGit Running git command [ 'reset', '--hard', 'HEAD' ] +18ms
lint-staged:execGit Running git command [ 'stash', 'list' ] +10ms
[FAILED] bun format [FAILED]
[FAILED] bun format [FAILED]
lint-staged:execGit Running git command [ 'stash', 'apply', '--quiet', '--index', '0' ] +9ms
lint-staged:GitWorkflow Restoring merge state... +44ms
lint-staged:GitWorkflow Done restoring merge state! +0ms
lint-staged:file Removing file /Users/arslonbekalimbayev/projects/comfi/merchant-dashboard.2.0/.git/lint-staged_unstaged.patch +81ms
lint-staged:file File /Users/arslonbekalimbayev/projects/comfi/merchant-dashboard.2.0/.git/lint-staged_unstaged.patch doesn't exist, ignoring... +0ms
lint-staged:GitWorkflow Done restoring original state! +0ms
[COMPLETED] Reverting to original state because of errors...
[STARTED] Cleaning up temporary files...
lint-staged:GitWorkflow Dropping backup stash... +0ms
lint-staged:execGit Running git command [ 'stash', 'list' ] +25ms
lint-staged:execGit Running git command [ 'stash', 'drop', '--quiet', '0' ] +8ms
lint-staged:GitWorkflow Done dropping backup stash! +13ms
[COMPLETED] Cleaning up temporary files...

✖ bun format:
$ prettier --write "/*.{json,ts,tsx,js,jsx,md,scss,css,html}" --no-error-on-unmatched-pattern /Users/arslonbekalimbayev/projects/comfi/merchant-dashboard.2.0/src/app/(auth)/layout.tsx
/bin/bash: -c: line 0: syntax error near unexpected token (' /bin/bash: -c: line 0: prettier --write "
/*.{json,ts,tsx,js,jsx,md,scss,css,html}" --no-error-on-unmatched-pattern /Users/arslonbekalimbayev/projects/comfi/merchant-dashboard.2.0/src/app/(auth)/layout.tsx'

✖ bun format:
$ prettier --write "/*.{json,ts,tsx,js,jsx,md,scss,css,html}" --no-error-on-unmatched-pattern /Users/arslonbekalimbayev/projects/comfi/merchant-dashboard.2.0/src/app/(auth)/layout.tsx
/bin/bash: -c: line 0: syntax error near unexpected token (' /bin/bash: -c: line 0: prettier --write "
/*.{json,ts,tsx,js,jsx,md,scss,css,html}" --no-error-on-unmatched-pattern /Users/arslonbekalimbayev/projects/comfi/merchant-dashboard.2.0/src/app/(auth)/layout.tsx'
error: "lint-staged" exited with code 1 (SIGHUP)
husky - pre-commit hook exited with code 1 (error)

@arslonbekXX
Copy link
Author

CleanShot 2023-12-14 at 15 37 47@2x

@arslonbekXX
Copy link
Author

telegram-cloud-photo-size-2-5465524078514393460-y

IMAGE 2023-12-14 15:45:41

I think the problem is in the name of this folder

@iiroj
Copy link
Member

iiroj commented Dec 14, 2023

This is probably the same issue as #962, so input is not escaped properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants