Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/duplicated_code.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Duplicated Code

on:
pull_request: null
push:
branches:
- main

env:
COMPOSER_ROOT_VERSION: "dev-main"

jobs:
duplicated_code:
runs-on: ubuntu-latest
timeout-minutes: 5

steps:
- uses: actions/checkout@v4

-
uses: shivammathur/setup-php@v2
with:
php-version: 8.4
coverage: none

- uses: "ramsey/composer-install@v2"

# fails when a large copy-pasted block (>= 150 tokens) is added
- run: composer duplicated-code
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"phpunit/phpunit": "^13.2",
"rector/jack": "^1.0",
"rector/rector-src": "dev-main",
"rector/swiss-knife": "^2.4",
"rector/swiss-knife": "^2.6",
"symplify/easy-coding-standard": "^13.2",
"symplify/phpstan-extensions": "^12.0",
"symplify/phpstan-rules": "^14.13.1",
Expand Down Expand Up @@ -46,6 +46,7 @@
"phpunit"
],
"phpstan": "vendor/bin/phpstan analyse --ansi",
"duplicated-code": "vendor/bin/swiss-knife duplicated-code src rules --min-tokens 150 --min-lines 5",
"check-cs": "vendor/bin/ecs check --ansi",
"class-leak": "vendor/bin/class-leak check config src rules --skip-suffix \"Rector\"",
"fix-cs": "vendor/bin/ecs check --fix --ansi",
Expand Down
Loading