"⚠ Some of your tasks use `git add` command."
See original GitHub issueDescription
I’m getting the message “⚠ Some of your tasks use git add
command.” during linting, but it isn’t clear what tasks it’s referring to.
Steps to reproduce
https://gist.github.com/jakearchibald/c5e18f54ddd9f8bb852e2d2abdbb3884
- Check out the above.
- Make a change to test.js.
- Stage the change.
- Run
./node_modules/.bin/lint-staged
Debug Logs
expand to view
lint-staged:bin Running `lint-staged@10.0.1` +0ms
lint-staged:bin Options parsed from command-line: {
allowEmpty: false,
concurrent: true,
configPath: undefined,
debug: true,
maxArgLength: 131072,
quiet: false,
relative: false,
shell: false
} +2ms
lint-staged Loading config using `cosmiconfig` +0ms
lint-staged Successfully loaded config from `/Users/jakearchibald/dev/buildoff/package.json`:
lint-staged { '*.{js,css,json,md,ts,tsx}': [ 'prettier --write', 'git add' ] } +28ms
lint-staged:cfg Validating config +0ms
Running lint-staged with the following config:
{
'*.{js,css,json,md,ts,tsx}': [
'prettier --write',
'git add'
]
}
lint-staged:run Running all linter scripts +0ms
lint-staged:git Running git command [ 'rev-parse', '--show-toplevel' ] +0ms
lint-staged:git Running git command [ 'rev-parse', '--show-superproject-working-tree' ] +23ms
lint-staged:run Resolved git directory to be `/Users/jakearchibald/dev/buildoff` +45ms
lint-staged:run Resolved git config directory to be `/Users/jakearchibald/dev/buildoff/.git` +0ms
lint-staged:git Running git command [ 'diff', '--staged', '--diff-filter=ACMR', '--name-only' ] +21ms
lint-staged:run Loaded list of staged files in git:
lint-staged:run [ 'test.js' ] +14ms
lint-staged:chunkFiles Resolved an argument string length of 41 characters from 1 files +0ms
lint-staged:chunkFiles Creating 1 chunks for maxArgLength of 131072 +0ms
lint-staged:gen-tasks Generating linter tasks +0ms
lint-staged:gen-tasks Generated task:
lint-staged:gen-tasks {
lint-staged:gen-tasks pattern: '*.{js,css,json,md,ts,tsx}',
lint-staged:gen-tasks commands: [ 'prettier --write', 'git add' ],
lint-staged:gen-tasks fileList: [ '/Users/jakearchibald/dev/buildoff/test.js' ]
lint-staged:gen-tasks } +3ms
lint-staged:make-cmd-tasks Creating listr tasks for commands [ 'prettier --write', 'git add' ] +0ms
lint-staged:task cmd: prettier --write /Users/jakearchibald/dev/buildoff/test.js +0ms
lint-staged:task execaOptions: { preferLocal: true, reject: false, shell: false } +0ms
lint-staged:task cmd: git add /Users/jakearchibald/dev/buildoff/test.js +0ms
lint-staged:task execaOptions: { preferLocal: true, reject: false, shell: false } +14ms
⚠ Some of your tasks use `git add` command. Please remove it from the config since all modifications made by tasks will be automatically added to the git commit index.
Preparing... [started]
lint-staged:git Backing up original state... +0ms
lint-staged:git Backing up merge state... +0ms
lint-staged:file Reading buffer from file `/Users/jakearchibald/dev/buildoff/.git/MERGE_HEAD` +0ms
lint-staged:file Reading buffer from file `/Users/jakearchibald/dev/buildoff/.git/MERGE_MODE` +0ms
lint-staged:file Reading buffer from file `/Users/jakearchibald/dev/buildoff/.git/MERGE_MSG` +0ms
lint-staged:file File `/Users/jakearchibald/dev/buildoff/.git/MERGE_HEAD` doesn't exist, ignoring... +4ms
lint-staged:file File `/Users/jakearchibald/dev/buildoff/.git/MERGE_MODE` doesn't exist, ignoring... +0ms
lint-staged:file File `/Users/jakearchibald/dev/buildoff/.git/MERGE_MSG` doesn't exist, ignoring... +0ms
lint-staged:git Done backing up merge state! +4ms
lint-staged:git Running git command [
'stash',
'save',
'--quiet',
'--include-untracked',
'--keep-index',
'lint-staged automatic backup'
] +39ms
lint-staged:git Restoring merge state... +92ms
lint-staged:git Done restoring merge state! +0ms
lint-staged:git Running git command [ 'ls-files', '--others', '--exclude-standard' ] +92ms
lint-staged:git Running git command [ 'stash', 'list' ] +6ms
lint-staged:git Running git command [
'diff',
'--binary',
'--unified=0',
'--no-color',
'--no-ext-diff',
'--patch',
'stash@{0}',
'-R'
] +16ms
lint-staged:git Done backing up original state! +29ms
Preparing... [completed]
Running tasks... [started]
Running tasks for *.{js,css,json,md,ts,tsx} [started]
prettier --write [started]
prettier --write [completed]
git add [started]
git add [completed]
Running tasks for *.{js,css,json,md,ts,tsx} [completed]
Running tasks... [completed]
Applying modifications... [started]
lint-staged:git Running git command [ 'ls-files', '--modified' ] +198ms
lint-staged:git Running git command [ 'status', '--porcelain' ] +7ms
lint-staged:git Running git command [ 'stash', 'list' ] +9ms
lint-staged:git Running git command [ 'show', '--format=%b', 'stash@{0}^3' ] +15ms
lint-staged:git Running git command [ 'apply', '-v', '--whitespace=nowarn', '--recount', '--unidiff-zero' ] +9ms
Applying modifications... [completed]
Cleaning up... [started]
lint-staged:git Dropping backup stash... +239ms
lint-staged:git Running git command [ 'stash', 'list' ] +8ms
lint-staged:git Running git command [ 'stash', 'drop', '--quiet', 'stash@{0}' ] +15ms
lint-staged:git Done dropping backup stash! +38ms
Cleaning up... [completed]
lint-staged tasks were executed successfully! +485ms
Environment
- OS: OSX 10.14.6
- Node.js: v12.4.0
lint-staged
: 10.0.1
Issue Analytics
- State:
- Created 4 years ago
- Reactions:7
- Comments:14 (1 by maintainers)
Top Results From Across the Web
lint-staged: what the purpose of 'git add' command
It's using husky to hooks some actions before your commit. See at: https://github.com/typicode/ ...
Read more >git-add Documentation - Git
This command updates the index using the current content found in the working tree, to prepare the content staged for the next commit....
Read more >提交时报错Some of your tasks use 'git add' command
提交时报错Some of your tasks use 'git add' command.
Read more >Git Add | Atlassian Git Tutorial
In review, git add is the first command in a chain of operations that directs Git to "save" a snapshot of the current...
Read more >Automating Linting: Using Husky and Lint-Staged
⚠ Some of your tasks use `git add ` command. Please remove it from the config since all modifications made by tasks will...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is covered in the changelog. Your configuration looks like the following:
From v10 onwards the
git add
part is automatic and not necessary to include in your configuration.@iiroj I appreciate your willingness a lot! If I look in my bin folder, I can’t see gpg2 folder. If I type in git command --no-verify, zsh says command not found. Sorry, I’ve not touch react for a while now. Can you be more specific what you mean by “if bin exist on my system”? I mean I see bin folder, but no hooks related names in it Below are my dependencies, does this help at least?