Comments (5)
Hello,
It is not executed during grumphp run
since it uses the git staged files to detect these keywords.
it only runs during pre-commit.
from grumphp.
Hello,
It is not executed during
grumphp run
since it uses the git staged files to detect these keywords. it only runs during pre-commit.
Hello there,
Thanks for getting to me so fast, true ! but still not failing ?
GrumPHP detected a pre-commit command.
GrumPHP is sniffing your code!
Running tasks with priority 0!
==============================
Running task 1/8: file_size... ✔
Running task 2/8: phpcs... ✔
Running task 3/8: git_branch_name... ✔
Running task 4/8: jsonlint...
Running task 5/8: phplint... ✔
Running task 6/8: securitychecker_enlightn...
Running task 7/8: git_blacklist...
Running task 8/8: composer...
🤖 Skipping gptcommit because the githook isn't set up for the "Message" commit mode.
GrumPHP detected a commit-msg command.
GrumPHP is sniffing your code!
Running tasks with priority 0!
==============================
Running task 1/1: git_commit_message... ✔
Changes:
➜ nanospa git:(last_bits_on_spa) git diff b31aeafbf0a35c506cd4d3828113e7b7f192865b
─────────────────────────────────────────────────────────────────────────────────┐
app/Listeners/LogUserHasLoggedOff.php:29: public function handle(Logout $logout) │
─────────────────────────────────────────────────────────────────────────────────┘
29 ⋮ 29 │ // no user is logged in
30 ⋮ 30 │ return;
31 ⋮ 31 │ }
32 ⋮ │ dd(1);
⋮ 32 │ dd(2);
33 ⋮ 33 │ activity()
34 ⋮ 34 │ ->useLog('auth')
35 ⋮ 35 │ ->event('logout')
─────────────────────────┐
grumphp.yml:48: grumphp: │
─────────────────────────┘
48 ⋮ 48 │ - "dd("
49 ⋮ 49 │ - "var_dump("
50 ⋮ 50 │ - "exit;"
51 ⋮ │ # whitelist_patterns:
52 ⋮ │ # - add(
⋮ 51 │ whitelist_patterns:
⋮ 52 │ - add(
53 ⋮ 53 │ regexp_type: G
54 ⋮ │ match_word: true
⋮ 54 │ match_word: false
55 ⋮ 55 │ composer:
What has changed?
from grumphp.
It might be so, that you need to apply keyword escaping, since (
is a reserved regex character.
See examples here:
https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/git_blacklist.md
from grumphp.
Hmm can not get it work, it runs but it has no tick?
Tried with " without, with match_word on and off..
grumphp:
stop_on_failure: true
process_timeout: 210
parallel:
enabled: true
max_workers: 32
tasks:
file_size:
max_size: 3M
ignore_patterns: []
phpcs:
standard: PSR2
warning_severity: 0
error_severity: 1
ignore_patterns:
- ./tests
- ./resources/*
- ./database
- ./bootstrap
- ./public
- ./config/
git_branch_name:
# whitelist:
# - '/([0-9]+)-/'
# - '/bugfix-*/'
blacklist:
- "/(shit|fuck|crap)/"
# - "develop"
# - "master"
git_commit_message:
allow_empty_message: false
enforce_capitalized_subject: false
enforce_no_subject_trailing_period: true
enforce_single_lined_subject: false
max_body_width: 400
max_subject_width: 200
case_insensitive: true
multiline: true
additional_modifiers: ""
jsonlint: null
phplint: null
securitychecker_enlightn:
lockfile: ./composer.lock
git_blacklist:
keywords:
- die\\(
- dump\\(
- dd\\(
- var_dump\\(
- exit;
whitelist_patterns:
- add(
regexp_type: G
match_word: false
composer:
from grumphp.
Not sure what's going wrong there, it seems to be working on my specific setup.
Maybe you'dd rather use something like
https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/phpparser.md
Or phpstan with https://github.com/ekino/phpstan-banned-code.
Both use PHP's AST to figure out if it's allowed or not which is less error prone on input like dump[space](
Whilst the blacklist task only checks for a regex match.
from grumphp.
Related Issues (20)
- PHPMD task does not check all file extensions HOT 5
- Don't do commit message checks on merges? HOT 8
- Memory is not being released in parallel execution HOT 3
- Grumphp running without `.git` folder? HOT 4
- Print the commit message when failing on `git_commit_message` HOT 4
- how can I use grum with docker-compose ? HOT 3
- Fails to Recognize PHPStan Baseline During Commit Workflow
- Override open_basedir only for grumphp test HOT 2
- Grumphp config using default PHPCS XML and other standard's sniff HOT 2
- Undefined constant PhpParser\ParserFactory::PREFER_PHP7 when using `nikic/php-parser` version 5. HOT 1
- Support multiple php versions for tasks HOT 2
- [Task] Add bin/console task for Symfony HOT 1
- husky/lint-staged compatibility HOT 5
- The application requires the version "^7.2" or greater. HOT 2
- Support for multiple PHPStan tasks HOT 2
- How do you think about a configuration to opt-in to continue the commit if fixer could fix everything automatically? HOT 2
- DistFileLoader doesn't import another file
- Add support for git_pre_push HOT 1
- Composer validate task not running when composer.lock changes
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grumphp.