SalamLang / Salam

Salam Language: The inaugural coding language for Persian and Arabic speakers, inspired by the word salam meaning peace. With a user-friendly approach, it provides an accessible coding experience, promoting collaboration and simplicity for local developers.
https://www.salamlang.ir
GNU General Public License v3.0
7 stars 6 forks source link

Branch: v3 - precommit issue #201

Closed BaseMax closed 2 weeks ago

BaseMax commented 3 weeks ago
C:\Users\MAX\Salam\src>git add .

C:\Users\MAX\Salam\src>git commit -m "Update"
[WARNING] Unstaged files detected.
[INFO] Stashing unstaged files to C:\Users\MAX\.cache\pre-commit\patch1723979095-17244.
identity.............................................(no files to check)Skipped
- hook id: identity
Check hooks apply to the repository..................(no files to check)Skipped
check for added large files..........................(no files to check)Skipped
check for case conflicts.............................(no files to check)Skipped
check that executables have shebangs.................(no files to check)Skipped
check for merge conflicts............................(no files to check)Skipped
check that scripts with shebangs are executable......(no files to check)Skipped
check vcs permalinks.................................(no files to check)Skipped
check yaml...........................................(no files to check)Skipped
detect destroyed symlinks............................(no files to check)Skipped
detect aws credentials...............................(no files to check)Skipped
detect private key...................................(no files to check)Skipped
fix end of files.....................................(no files to check)Skipped
fix utf-8 byte order marker..........................(no files to check)Skipped
forbid submodules....................................(no files to check)Skipped
mixed line ending....................................(no files to check)Skipped
trim trailing whitespace.............................(no files to check)Skipped
Run codespell........................................(no files to check)Skipped
Markdown Link Check..................................(no files to check)Skipped
Run markdownlint.....................................(no files to check)Skipped
Run yamllint.........................................(no files to check)Skipped
[INFO] Restored changes from C:\Users\MAX\.cache\pre-commit\patch1723979095-17244.
On branch v3
Your branch is up to date with 'origin/v3'.

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

no changes added to commit (use "git add" and/or "git commit -a")
jbampton commented 3 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
BaseMax commented 3 weeks ago

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
jbampton commented 3 weeks ago

Looks good. All those can either be fixed or excluded

BaseMax commented 3 weeks ago

pls do it if needed