{"id":15284560,"url":"https://github.com/axelerant/drupal-quality-checker","last_synced_at":"2025-04-08T03:14:26.638Z","repository":{"id":47155808,"uuid":"222828462","full_name":"axelerant/drupal-quality-checker","owner":"axelerant","description":"Pre-commit code quality checker for Drupal based projects.","archived":false,"fork":false,"pushed_at":"2024-12-21T12:39:39.000Z","size":88,"stargazers_count":13,"open_issues_count":6,"forks_count":9,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-31T18:22:08.387Z","etag":null,"topics":["drupal","git","grumphp","phpcs"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/axelerant/drupal-quality-checker","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/axelerant.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-20T01:57:32.000Z","updated_at":"2025-02-10T08:37:51.000Z","dependencies_parsed_at":"2023-12-21T20:29:09.043Z","dependency_job_id":"8cd72df0-ffdd-49c0-964e-a1baa706ce79","html_url":"https://github.com/axelerant/drupal-quality-checker","commit_stats":{"total_commits":74,"total_committers":13,"mean_commits":"5.6923076923076925","dds":"0.41891891891891897","last_synced_commit":"b60edafed77270506169f739e887753009b501d6"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axelerant%2Fdrupal-quality-checker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axelerant%2Fdrupal-quality-checker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axelerant%2Fdrupal-quality-checker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axelerant%2Fdrupal-quality-checker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/axelerant","download_url":"https://codeload.github.com/axelerant/drupal-quality-checker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247767236,"owners_count":20992548,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["drupal","git","grumphp","phpcs"],"created_at":"2024-09-30T14:58:29.356Z","updated_at":"2025-04-08T03:14:26.603Z","avatar_url":"https://github.com/axelerant.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Package for Drupal Code Quality presets\n\nThis has been customised from [vijaycs85/drupal-quality-checker](https://packagist.org/packages/vijaycs85/drupal-quality-checker) for Axelerant needs. Apart from a different template file, it uses the Axelerant logo.\n\n## Installation\n\n_Upgrading from Beta 8?_ Read [the instructions for changes](#upgrading-from-beta-8) you need to make to grumphp.yml.dist.\n\n```bash\ncomposer require --dev axelerant/drupal-quality-checker\n```\n\nThis will add the plugin to your project and copy the default configuration files. These files are:\n\n* grumphp.yml.dist\n* phpcs.xml.dist\n* phpmd.xml.dist\n* phpstan.neon.dist\n\nSince these are `.dist` files, the plugin will overwrite them on every `composer install`. If you mean to customize the default settings, then we recommend that you rename them to remove the `.dist` suffix. As such, it is a good idea to add these `.dist` files to your `.gitignore` file.\n\n## Usage\n\nNo additional steps required, but if git hooks aren't fired, run `php ./vendor/bin/grumphp git:init`. For additional commands, look at [grumhp's documentation](https://github.com/phpro/grumphp/blob/master/doc/commands.md).\n\n## Customising\n\nAlmost all customising begins with first copying the `grumphp.yml.dist` file to your project. Make sure you have the file.\n\n### Adding tasks\n\nThere are various tasks you can add and customise in your grumphp.yml. Read the [online documentation for GrumPHP tasks](https://github.com/phpro/grumphp/blob/master/doc/tasks.md) to see the tasks you can use and configure.\n\n### Forcing commit message format\n\nTo configure commit message structure, use the [git_commit_message task](https://github.com/phpro/grumphp/blob/master/doc/tasks/git_commit_message.md). For example, to enforce the commit message contains the Jira issue ID, use the rule as the following snippet. More options are [documented online](https://github.com/phpro/grumphp/blob/master/doc/tasks/git_commit_message.md).\n\n```yaml\n# grumphp.yml\ngrumphp:\n  tasks:\n    git_commit_message:\n      matchers:\n        Must contain issue number: /JIRA-\\d+/\n```\n\n### Disable commit banners\n\nGrumPHP supports banners to celebrate (or scold) on your commit. This is fun but it is possible it gets on your nerves. If you don’t want it, edit the grumphp.yml file and replace the following parameters:\n\n```yaml\n# grumphp.yml\ngrumphp:\n    ascii: ~\n```\n\nYou could even disable specific ones like this:\n\n```yaml\n# grumphp.yml\ngrumphp:\n    ascii:\n        succeeded: ~\n```\n\n### Overwrite phpmd ruleset\n\nCopy the ruleset to the project root first\n\n```bash\ncp vendor/axelerant/drupal-quality-checker/phpmd.xml.dist phpmd.xml\n```\n\nEdit it as per your needs and commit. Remember to modify the grumphp.yml file with the new path.\n\n```yaml\n# grumphp.yml\ngrumphp:\n  tasks:\n    phpmd:\n      ruleset: ['phpmd.xml']\n```\n\n### Customise phpcs rules\n\nCopy the ruleset to the project root first\n\n```bash\ncp vendor/axelerant/drupal-quality-checker/phpcs.xml.dist phpcs.xml\n```\n\nEdit it as per your needs and commit. Remember to modify the grumphp.yml file with the new path.\n\n```yaml\n# grumphp.yml\ngrumphp:\n  tasks:\n    phpcs:\n      standard: ['phpcs.xml']\n```\n\n### Customise phpstan rules\n\nCopy the ruleset to the project root first\n\n```bash\ncp vendor/axelerant/drupal-quality-checker/phpstan.neon.dist phpstan.neon\n```\n\nEdit it as per your needs and commit. Remember to modify the grumphp.yml file with the new path.\n\n```yaml\n# grumphp.yml\ngrumphp:\n  tasks:\n    phpstan:\n      configuration: phpstan.neon\n```\n\n## More about scaffolding\n\nAs described before, this package uses [`drupal/core-composer-scaffold`](https://github.com/drupal/core-composer-scaffold) plugin to scaffold a few files to the project root. This is not required but there is a good chance you are already using it if you're building a Drupal site.\n\nThe scaffolding operation runs with every composer operation and overwrites files. Only the file `grumphp.yml.dist` is not overwritten during subsequent operations. If you are customising any of the other configuration files and don't want the updates to overwrite your changes, you can override the behaviour in your composer.json file. For example, to skip `phpmd.xml.dist` from being overwritten, add this to your `composer.json`:\n\n```json\n  \"name\": \"my/project\",\n  ...\n  \"extra\": {\n    \"drupal-scaffold\": {\n      \"file-mapping\": {\n        \"[project-root]/phpmd.xml.dist\": false\n      }\n    }\n  }\n```\n\nFor more details, read the [\"Excluding Scaffold files\"](https://github.com/drupal/core-composer-scaffold#excluding-scaffold-files) section of the [documentation](https://github.com/drupal/core-composer-scaffold/blob/8.8.x/README.md) for the core-composer-scaffold plugin.\n\n## Upgrading from Beta 8\n\nGrumPHP 0.19 introduced [a breaking change](https://github.com/phpro/grumphp/releases/tag/v0.19.0) to the structure of the YAML file. The template in this repository is updated as per the new structure. However, you would need to change the YML files on your projects before you update to Beta 9 or later.\n\nFortunately, the change is simple and in many cases would only require a one line change. Rename the `parameters` section to `grumphp`. Our default template contains two parameters which still need to remain under `parameters`. They are `git_dir` and `bin_dir`. Look at [the diff of the change](https://github.com/axelerant/drupal-quality-checker/commit/e8d9414ce6ea046b0386115764db68e5251d8a58#diff-94c8df1b4af91d80f7417cad14bbe0e5) to understand what needs to be changed in your grumphp.yml file. Also, read more at the [release page for GrumPHP 0.19](https://github.com/phpro/grumphp/releases/tag/v0.19.0).\n\nLastly, you can [watch this video](https://youtu.be/XoFJfBcZF58) where I upgrade this on a project. Link: https://youtu.be/XoFJfBcZF58\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxelerant%2Fdrupal-quality-checker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faxelerant%2Fdrupal-quality-checker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxelerant%2Fdrupal-quality-checker/lists"}