mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-11-26 02:27:23 +01:00
Fix pre-commit OOM: batch cppcheck, cap Node heap, fail-fast
- cppcheck: process files one-at-a-time (xargs -n 1) + --check-level=normal - eslint: cap Node.js heap to 512MB via NODE_OPTIONS - Set fail_fast: true to avoid stacking memory-heavy hooks - Remove ulimit -v (ineffective with Linux memory overcommit)
This commit is contained in:
parent
6d63866179
commit
9b003c0ae8
@ -11,8 +11,8 @@
|
|||||||
default_language_version:
|
default_language_version:
|
||||||
python: python3
|
python: python3
|
||||||
|
|
||||||
# Fail fast on first error (set to false to see all errors)
|
# Fail fast on first error — also prevents stacking memory-heavy hooks
|
||||||
fail_fast: false
|
fail_fast: true
|
||||||
|
|
||||||
# Configuration
|
# Configuration
|
||||||
ci:
|
ci:
|
||||||
@ -337,22 +337,10 @@ repos:
|
|||||||
hooks:
|
hooks:
|
||||||
- id: cppcheck
|
- id: cppcheck
|
||||||
name: cppcheck
|
name: cppcheck
|
||||||
entry: bash -c 'ulimit -v 3145728; exec cppcheck "$@"' --
|
entry: bash -c 'printf "%s\0" "$@" | xargs -0 -n 1 cppcheck --enable=warning,portability --check-level=normal --quiet --error-exitcode=1 --inline-suppr --suppress=missingIncludeSystem --suppress=syntaxError --suppress=nullPointerOutOfResources --suppress=ctunullpointerOutOfResources --suppress=ctunullpointerOutOfMemory --std=c11' --
|
||||||
language: system
|
language: system
|
||||||
types_or: [c, c++]
|
types_or: [c, c++]
|
||||||
exclude: ^(pomodoro_app/|horatio/)
|
exclude: ^(pomodoro_app/|horatio/)
|
||||||
args:
|
|
||||||
- --enable=warning,portability
|
|
||||||
- --check-level=normal
|
|
||||||
- --quiet
|
|
||||||
- --error-exitcode=1
|
|
||||||
- --inline-suppr
|
|
||||||
- --suppress=missingIncludeSystem
|
|
||||||
- --suppress=syntaxError
|
|
||||||
- --suppress=nullPointerOutOfResources
|
|
||||||
- --suppress=ctunullpointerOutOfResources
|
|
||||||
- --suppress=ctunullpointerOutOfMemory
|
|
||||||
- --std=c11
|
|
||||||
|
|
||||||
# ===========================================================================
|
# ===========================================================================
|
||||||
# FLAWFINDER - C/C++ security scanner
|
# FLAWFINDER - C/C++ security scanner
|
||||||
@ -376,7 +364,7 @@ repos:
|
|||||||
hooks:
|
hooks:
|
||||||
- id: eslint
|
- id: eslint
|
||||||
name: eslint
|
name: eslint
|
||||||
entry: npx eslint --no-warn-ignored
|
entry: bash -c 'NODE_OPTIONS="--max-old-space-size=512" npx eslint --no-warn-ignored "$@"' --
|
||||||
language: system
|
language: system
|
||||||
types_or: [ts, tsx]
|
types_or: [ts, tsx]
|
||||||
files: ^TS/
|
files: ^TS/
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user