{"id":36398564,"url":"https://github.com/staempfli/typo3-conventions-checker","last_synced_at":"2026-01-11T16:01:36.646Z","repository":{"id":57058889,"uuid":"105107571","full_name":"staempfli/typo3-conventions-checker","owner":"staempfli","description":null,"archived":false,"fork":false,"pushed_at":"2018-07-10T06:31:09.000Z","size":20,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":9,"default_branch":"develop","last_synced_at":"2024-11-29T10:50:09.496Z","etag":null,"topics":["coding-conventions","typo3"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/staempfli.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-28T05:53:56.000Z","updated_at":"2024-02-12T12:14:53.000Z","dependencies_parsed_at":"2022-08-24T14:53:23.885Z","dependency_job_id":null,"html_url":"https://github.com/staempfli/typo3-conventions-checker","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/staempfli/typo3-conventions-checker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staempfli%2Ftypo3-conventions-checker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staempfli%2Ftypo3-conventions-checker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staempfli%2Ftypo3-conventions-checker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staempfli%2Ftypo3-conventions-checker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/staempfli","download_url":"https://codeload.github.com/staempfli/typo3-conventions-checker/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staempfli%2Ftypo3-conventions-checker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28312095,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T14:58:17.114Z","status":"ssl_error","status_checked_at":"2026-01-11T14:55:53.580Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["coding-conventions","typo3"],"created_at":"2026-01-11T16:00:45.415Z","updated_at":"2026-01-11T16:01:36.629Z","avatar_url":"https://github.com/staempfli.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TYPO3 Conventions Checker\n\n## What does it do?\nThis package lets you automatically test any changed code against the\n[TYPO3 file formatting requirements][1] right before you commit your changes.\nIt also forces you to keep the commit messages tidy, according to the\n[TYPO3 contribution workflow][2]. There are some checks we're\nleaving out, though, as the commit message structure applies to\nTYPO3 core contributions and we're not usually committing to the\ncore repository in our projects, eh.\n\nThis works via Git hooks, so every time you type 'git commit ...',\nthe configured GrumPHP tasks get fired.\n\nThe package itself doesn't do much, honestly. :) It provides some\nconfiguration and requires some dependencies to get your\ncode quality and conventions checks set up in no time.\n\n## But how does it do it?\nPretty simple. It requires [GrumPHP][3]\nwhich hits up the [PHP Coding Standards Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer)\nand well as the [PHP Mess Detector](https://github.com/phpmd/phpmd)\non each and every commit of yours. Only the files you're trying\nto commit are getting checked for any coding standards violations\nor code messes.\n\n## Installing\n### Prerequisites / TYPO3 project setup\nThis package expects you work with a composer-based TYPO3 setup, having a\n(probably versioned) composer manifest outside your public html\ndirectory called 'web' (though you may of course reconfigure\nthis directory's name). Something along the lines of:\n```\n- your-typo3-project/\n  - bin\n  - vendor\n  (...)\n  - composer.json\n  - web\n    - fileadmin\n    - typo3\n    - typo3conf\n    (...)\n```\n\n- Reference the GrumPHP configuration file (`grumphp.yml`) in the\n\"extra\" section of your root composer manifest:\n```yaml\n(...)\n  \"extra\": {\n    \"grumphp\": {\n      \"config-default-path\": \"vendor/staempfli/typo3-conventions-checker/conf/grumphp.yml\"\n    }\n  }\n```\n(Alternatively, you can create a custom grumphp.yml file in your git root\ndirectory, this will work as well).\n- Require this package via composer `composer require --dev \"staempfli/typo3-conventions-checker\"`\n- Commit changes to your project. All checks will be run automagically on commit.\n\n## Options and Customizing\n### Default configuration\nPer default, this package uses\n- a [php-cs-fixer](./conf/PhpCsFixer.php) configuration corresponding to the\n[TYPO3 core php-cs-fixer configuration](https://github.com/TYPO3/TYPO3.CMS/blob/master/Build/.php_cs)\n- Git commit message rules, mainly integrating the [TYPO3 core commit message format][2], excluding\n  the ones specific to the TYPO3 core contribution workflow such as the\n  'Releases' and/or 'Change-Id' requirements\n- ([see full configuration in /conf/grumphp.yml](./conf/grumphp.yml))\n\n### Override (i.e. 'extend') configuration\nFor this to work, you need to create your own grumphp.yml in your\ngit root directory according to the [GrumPHP][3] configuration. In there,\nyou may reference this package's grumphp configuration and override\nthe settings.\n\n**Important notice on inheritance**: To my knowledge, it is not possible\nto recursively inherit task settings, meaning: **you override one\nproperty/setting of a task (see example below), you need to re-define all\ntasks and their settings**. [See the grumphp configuration provided\nfor extensions](./conf/grumphp-extensions.yml).\n\n\n#### Example 1: Reconfiguring the git commit message restrictions\n\nLet's say you want to limit the git commit message length\nto 42 characters. Update your\n`grumphp.yml` from\n```yaml\nimports:\n    - { resource: vendor/staempfli/typo3-conventions-checker/conf/grumphp.yml }\n```\nto something like\n```yaml\nimports:\n    - { resource: vendor/staempfli/typo3-conventions-checker/conf/grumphp.yml }\nparameters:\n    tasks:                \n        git_commit_message:\n            max_subject_width: 42\n\n        (other tasks' configuration with or without customization)\n```\n\n\n#### Example 2: Customizing the php-cs-fixer configuration\nLike in the first example: reconfigure this via the grumphp\nconfiguration. This time though, reference a different\n(your own) php-cs-fixer configuration:\n```yaml\nimports:\n    - { resource: vendor/staempfli/typo3-conventions-checker/conf/grumphp.yml }\nparameters:\n    tasks:\n        phpcsfixer2:\n            config: 'your/own/PhpCsFixer/conf.php'\n\n        (other tasks' configuration with or without customization)\n```\n\n## Initializing extensions\nLet's say, you maintain an extension 'mynews' and\nof course, you want the code of 'mynews' to comply with some\ncoding standards as well. You're working on the main project,\nwhere 'mynews' is included as a dependency but you'll probably\nintroduce changes to 'mynews' while working on the main project.\nBut, because 'mynews' is its own git repository, it doesn't get\nchecked by GrumPHP automatically if you just initialized GrumPHP on\nyour main project as described above.\n```\n- main-typo3-project/\n  - composer.json\n  - web\n    - fileadmin\n    - typo3\n    - typo3conf\n      - ext\n        - mynews \u003c= doesn't get initialized by GrumPHP\n    (...)\n```\nLucky you! You're just 2 baby steps away from forcing all\ncommits to 'mynews' to get checked by GrumPHP.\n\n1. Add a reference to a grumphp.yml configuration via composer manifest of\nthe 'mynews' extension or create a custom grumphp.yml in the extension's\nroot directory. Note that this package already provides a\n[dedicated grumphp configuration](./conf/grumphp-extensions.yml)\nthat respects the extension directory nesting.\n\nVia 'extra' section of the composer manifest of the extension:\n```json\n  (...)\n    \"extra\": {\n        \"grumphp\": {\n            \"config-default-path\": \"./../../../../vendor/staempfli/typo3-conventions-checker/conf/grumphp-extensions.yml\"\n        }\n    }\n```\nVia grumphp.yml in the root directory of the extension:\n```yaml\nimports:\n    - { resource: ./../../../../vendor/staempfli/typo3-conventions-checker/conf/grumphp-extensions.yml }\n```\n\n2. In your root composer manifest, run the 'initializeExtensions'\nmethod via composer scripts. Let's say, after each `composer update`, eh?\n```json\n(...)\n\"scripts\": {\n  \"post-update-cmd\": [\n    \"Staempfli\\\\Typo3ConventionsChecker\\\\Composer\\\\Grumphp::initializeExtensions\",\n  ],\n},\n(...)\n```\n\u003cbr /\u003e\n\n#### Windows users\nThere currently is a bug, which leads to wrong paths of the grumphp\nexecutable in the git hooks when used inside extensions as described\nabove. You might experience git cli responding with an error that the\nGrumPHP executable could not be found. The reason for that is the\nwrong registration in `.git/hooks/pre-commit` as well as\n`.git/hooks/commit-message`.\n\n**Solution**: In the files mentioned above, the calls to GrumPHP\nmight look something like this:\n```\n# Run GrumPHP\n(cd \"./\" \u0026\u0026 printf \"%s\\n\" \"${DIFF}\" | exec X:\\path\\to\\your-site\\web\\vendor\\bin\\grumphp git:pre-commit '--skip-success-output')\n```\nNotice that the path to the GrumPHP executable is not in enclosed in quotes and\nwill lead to errors. Just enclose \"X:\\path (...) grumphp\" in double\nquotes and you're all set:\n```\n# Run GrumPHP\n(cd \"./\" \u0026\u0026 printf \"%s\\n\" \"${DIFF}\" | exec \"X:\\path\\to\\your-site\\web\\vendor\\bin\\grumphp\" git:pre-commit '--skip-success-output')\n```\n\n[1]: https://docs.typo3.org/typo3cms/CodingGuidelinesReference/PhpFileFormatting/GeneralRequirementsForPhpFiles/Index.html\n[2]: https://docs.typo3.org/typo3cms/ContributionWorkflowGuide/GitSetup/CommitMessageFormat.html\n[3]: https://github.com/phpro/grumphp","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstaempfli%2Ftypo3-conventions-checker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstaempfli%2Ftypo3-conventions-checker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstaempfli%2Ftypo3-conventions-checker/lists"}