{"id":15937642,"url":"https://github.com/innoraft/drupal-quality-checker","last_synced_at":"2025-03-17T23:32:22.707Z","repository":{"id":62890407,"uuid":"563238397","full_name":"innoraft/drupal-quality-checker","owner":"innoraft","description":"Code quality checker for Drupal based projects.","archived":false,"fork":false,"pushed_at":"2024-11-05T11:21:48.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-21T21:18:37.324Z","etag":null,"topics":["drupal","github","grumphp","php","phpcs","reactor","trufflehog"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/innoraft/drupal-quality-checker","language":"Shell","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/innoraft.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-08T07:39:04.000Z","updated_at":"2024-10-30T17:20:54.000Z","dependencies_parsed_at":"2023-01-22T11:30:08.246Z","dependency_job_id":"e2b473af-8c1d-4d32-afdc-84f2767a1974","html_url":"https://github.com/innoraft/drupal-quality-checker","commit_stats":{"total_commits":15,"total_committers":3,"mean_commits":5.0,"dds":"0.33333333333333337","last_synced_commit":"a6cf74c257987c4fd9ba17883a5f05318d5f93ca"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/innoraft%2Fdrupal-quality-checker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/innoraft%2Fdrupal-quality-checker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/innoraft%2Fdrupal-quality-checker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/innoraft%2Fdrupal-quality-checker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/innoraft","download_url":"https://codeload.github.com/innoraft/drupal-quality-checker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243893412,"owners_count":20364896,"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","github","grumphp","php","phpcs","reactor","trufflehog"],"created_at":"2024-10-07T05:04:23.103Z","updated_at":"2025-03-17T23:32:22.481Z","avatar_url":"https://github.com/innoraft.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Drupal Code Quality Checker\n---\n\n## Overview\n\nThis composer package will provide some basic code quality checks before committing code by using https://github.com/phpro/grumphp. Check out this [Lullabot article](https://www.lullabot.com/articles/how-enforce-drupal-coding-standards-git) for more details.\n\nThis has been customised from [vijaycs85/drupal-quality-checker](https://packagist.org/packages/vijaycs85/drupal-quality-checker) for Innoraft needs.\n\n\n## Install\n\n1. Add `innoraft/drupal-quality-checker` to `composer.json` or just run\n\n    ```bash\n    composer require --dev innoraft/drupal-quality-checker\n    ```\n2. Replace `grumphp.yml` in project's root directory (not Drupal root directory)\nwith `vendor/innoraft/drupal-quality-checker/grumphp.yml.dist`\n\nThat's it. Now, all tasks (listed below) run on every `git commit`.\n\n\u003e*Note:* As part of install, GrumPHP adds `pre-commit` hook to repository. Existing `pre-commit` might get [destroyed](https://github.com/phpro/grumphp/issues/416) when install/uninstall.\n\n## Out of the box\n\n1. [PHPCS](https://github.com/squizlabs/PHP_CodeSniffer) with Drupal standard.\n2. [PHP Lint](http://www.icosaedro.it/phplint/)\n3. [YAML Lint](http://www.yamllint.com/)\n4. [Composer](https://github.com/composer/composer)\n5. [Composer Normalize](https://github.com/ergebnis/composer-normalize)\n6. [JSONLint](https://jsonlint.com/)\n7. [Trufflehog](https://trufflesecurity.com/trufflehog/)\n\nLong list of additional checks/validators available [here](https://github.com/phpro/grumphp/blob/master/doc/tasks.md#tasks-1).\n\n## To automatically setup all the packages, follow the below steps:\n\n1. Download the [setup.sh](setup.sh) file and place it outside the docroot.\n2. Update Line 12 of setup.sh having the command ``composer require --dev innoraft/drupal-quality-checker``. Use the appropriate environment for your setup. For example, if you are working with Lando, \n   use ``lando composer require --dev innoraft/drupal-quality-checker``. \n3. Update Line 102 of setup.sh having the command ``composer dump-autoload``. Use the appropriate environment for your setup. For example, if you are working with Lando, \n   use ``lando composer dump-autoload``. \n4. From outside the docroot run this command that will make the bash script executable\n\n   ```bash\n   chmod +x setup.sh\n   ```\n5. To execute the bash script run this command from outside the docroot \n\n   ```bash\n   ./setup.sh\n   ```\n6. After executing the script, a prompt will appear asking for the base directory name , site name and custom theme name, which need to be entered\n   ![cmd](https://github.com/user-attachments/assets/7fdb6c2e-843b-44a9-9f28-08e8f2470e8f)\n\n7. Few other prompts will appear where consent is needed to download the required package for the configuration\n\n   ![image](https://github.com/user-attachments/assets/e7a904dc-90a8-41de-97cf-1fa2c4129dfc)\n\n8. When prompted for tasks to run, select any option, as grumphp.yml is already included in the package and will be used for setup, making this selection less critical:\n\n   ![image](https://github.com/user-attachments/assets/930fce63-51c8-4ff0-951c-61dc8644c1f9)\n\n9. After this, please wait for some time for the script to execute and the setup to be completed.\n\n\n## Incase you want to install them individually, follow the below steps:\n\n## ESLint task Setup\n\n1. Go to custom theme folder and add eslint package with npm\n    ```bash\n    npm install eslint --save-dev\n    npm install eslint-config-airbnb --save-dev\n    ```\n\n2. Now run this command at project's root directory\n    ```bash\n    cp vendor/innoraft/drupal-quality-checker/eslintrc.json.dist .eslintrc.json\n    ```\n    For multisite run the following command\n   ```bash\n    cp vendor/innoraft/drupal-quality-checker/eslintrc.json.dist docroot/sites/\u003csitename\u003e/themes/custom/\u003cthemename\u003e/.eslintrc.json\n    ```\n4. Update bin key for eslint task under grumphp.yml file with relative address to eslint's bin file.\n\n    Example: if your theme name is `drupal_theme` then change it to `web/themes/custom/drupal_theme/node_modules/.bin/eslint`\n\n## Stylelint task Setup\n\n1. Go to custom theme folder and add stylelint package with npm\n    ```bash\n    npm install stylelint --save-dev\n    ```\n\n2. Now run this command at project's root directory\n    ```bash\n    cp vendor/innoraft/drupal-quality-checker/stylelintrc.json.dist .stylelintrc.json\n    ```\n    For multisite run the following command\n   ```bash\n    cp vendor/innoraft/drupal-quality-checker/stylelintrc.json.dist docroot/sites/\u003csitename\u003e/themes/custom/\u003cthemename\u003e/.stylelintrc.json\n    ```\n3. For multisite run the following command\n    ```bash\n    npm install stylelint-config-standard\n    ```\n4. Update bin key for stylelint task under grumphp.yml file with relative address to stylelint's bin file.\n\n    Example: if your theme name is `drupal_theme` then change it to `web/themes/custom/drupal_theme/node_modules/.bin/stylelint`\n\n## Trufflehog task Setup\n\n1. Create a new folder `tasks` at project's root level.\n\n2. Now run this command at project's root directory\n    ```bash\n    cp vendor/innoraft/drupal-quality-checker/tasks/SecurityLeaks.php tasks\n    ```\n\n3. Now add the following code in your `composer.json` file which is present at project's root directory. ( For reference you can check `composer.json` file of this package )\n    ```bash\n    \"autoload\": {\n        \"psr-4\": {\n            \"Innoraft\\\\QualityChecker\\\\Trufflehog\\\\\": \"tasks\"\n        }\n    },\n    ```\n    Once the code is added in `composer.json` then execute this command\n    ```bash\n    composer dump-autoload\n    ```\n4. Install `trufflehog` ( If not already install ). You can execute the following command to achieve the same.\n    ```bash\n    curl -sSfL https://raw.githubusercontent.com/trufflesecurity/trufflehog/main/scripts/install.sh | sh -s -- -b $HOME/.local/bin\n    ```\n\n5. Please check and confirm if your `grumphp.yml` is updated with `vendor/innoraft/drupal-quality-checker/grumphp.yml.dist` ( Check and confirm if trufflehog tasks \u0026 service attribute is added in `grumphp.yml` file )\n\n6. `Trufflehog` is now ready to sniff your secrets `:)`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finnoraft%2Fdrupal-quality-checker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finnoraft%2Fdrupal-quality-checker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finnoraft%2Fdrupal-quality-checker/lists"}