Closed BaseMax closed 2 weeks ago
You should always run pre-commit
or your Git commands
from the repo root.
You have made the mistake of running your Git commands from the src
directory:
C:\Users\MAX\Salam\src>git add .
So that the files were never staged with git add .
[WARNING] Unstaged files detected.
And then further down you can see you have your changes not staged as well as the untracked file:
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: ../out/index.html
modified: ../out/style.css
modified: ../test/input.s
Untracked files:
(use "git add <file>..." to include in what will be committed)
../test/form.salam
wsL;
max@DESKTOP-SSI3MPL:/mnt/c/Users/MAX/Salam/src$ cd ..
max@DESKTOP-SSI3MPL:/mnt/c/Users/MAX/Salam$ pre-commit
[WARNING] Unstaged files detected.
[INFO] Stashing unstaged files to /home/max/.cache/pre-commit/patch1723980112-214923.
[INFO] Installing environment for https://github.com/tcort/markdown-link-check.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Restored changes from /home/max/.cache/pre-commit/patch1723980112-214923.
An unexpected error has occurred: CalledProcessError: command: ('/usr/bin/bash', '/mnt/c/Program Files/nodejs/npm', 'pack')
return code: 1
stdout: (none)
stderr:
npm error code ERR_INVALID_URL
npm error Invalid URL
npm error A complete log of this run can be found in: C:\Users\MAX\AppData\Local\npm-cache\_logs\2024-08-18T11_22_05_544Z-debug-0.log
Check the log at /home/max/.cache/pre-commit/pre-commit.log
and git:
C:\Users\MAX\Salam>git status
On branch v3
Your branch is up to date with 'origin/v3'.
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
modified: out/index.html
modified: out/style.css
new file: test/form.salam
modified: test/input.s
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: out/index.html
modified: out/style.css
modified: src/ast_layout.c
modified: src/ast_layout.h
modified: src/generator_layout.c
modified: src/hashmap.h
modified: src/parser.c
modified: test/form.salam
modified: test/input.s
Untracked files:
(use "git add <file>..." to include in what will be committed)
src/ast_layout_attribute_style_state_type.h
C:\Users\MAX\Salam>git add .
warning: in the working copy of 'out/index.html', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'out/style.css', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'src/ast_layout.c', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'src/ast_layout.h', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'src/generator_layout.c', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'src/hashmap.h', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'src/parser.c', LF will be replaced by CRLF the next time Git touches it
C:\Users\MAX\Salam>git commit -m "adding ADD_LAYOUT_ATTRIBUTE_STYLE_STATE_TYPE - run precommit"
identity.................................................................Passed
- hook id: identity
- duration: 0.38s
src/ast_layout_attribute_style_state_type.h
out/index.html
src/generator_layout.c
out/style.css
test/form.salam
src/hashmap.h
src/ast_layout.c
src/ast_layout.h
src/parser.c
test/input.s
Check hooks apply to the repository..................(no files to check)Skipped
check for added large files..............................................Passed
check for case conflicts.................................................Passed
check that executables have shebangs.....................................Passed
check for merge conflicts................................................Passed
check that scripts with shebangs are executable..........................Passed
check vcs permalinks.....................................................Passed
check yaml...........................................(no files to check)Skipped
detect destroyed symlinks................................................Passed
detect aws credentials...................................................Passed
detect private key.......................................................Passed
fix end of files.........................................................Failed
- hook id: end-of-file-fixer
- exit code: 1
- files were modified by this hook
Fixing src/ast_layout_attribute_style_state_type.h
fix utf-8 byte order marker..............................................Passed
forbid submodules....................................(no files to check)Skipped
mixed line ending........................................................Passed
trim trailing whitespace.................................................Failed
- hook id: trailing-whitespace
- exit code: 1
- files were modified by this hook
Fixing src/generator_layout.c
Fixing src/hashmap.h
Fixing src/ast_layout.c
Fixing src/ast_layout.h
Fixing src/parser.c
Run codespell............................................................Failed
- hook id: codespell
- exit code: 65
src/generator_layout.c:420: Someting ==> Something
src/parser.c:495: mroe ==> more
Markdown Link Check..................................(no files to check)Skipped
Run markdownlint.....................................(no files to check)Skipped
Run yamllint.........................................(no files to check)Skipped
Looks good. All those can either be fixed or excluded
pls do it if needed