Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use php code sniffer #30

Merged
merged 19 commits into from
Mar 13, 2024
Merged

feat: use php code sniffer #30

merged 19 commits into from
Mar 13, 2024

Conversation

rishtigupta
Copy link
Contributor

@rishtigupta rishtigupta commented Mar 12, 2024

PR Description:

What does this commit do?

  1. We enrolled in listing momento to drupal index org. (https://www.drupal.org/project/projectapplications/issues/3427212#comment-15486454).

They use a code sniffer that points out linting issues/doc comments and any other code spells. This commit updates the files based on running the PHPCS code sniffer.

Installation Instructions:

  • Used Drupal server (Amazon EC2 instance) to run the drupal demo website
  • Update the server's composer.json to use feat/phpcs branch
  • Install phpcs code sniffer (https://github.com/PHPCSStandards/PHP_CodeSniffer/)
  • Install drupal/coder (https://www.drupal.org/docs/contributed-modules/code-review-module/installing-coder)
  • Run phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml web/modules/contrib/drupal-cache/ to detect errors + warnings
  • Run phpcbf --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml web/modules/contrib/drupal-cache/ to fix most of the errors. Some had to be done manually which the phpcbf could not.
  • Copy the correct file from ec2 instance to local machine and replaced the existing code with the updated code.
  1. Uncomments the phpcs extension on push/pull request to main

@rishtigupta rishtigupta marked this pull request as ready for review March 12, 2024 23:23
Copy link
Collaborator

@pgautier404 pgautier404 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:ty:

@rishtigupta rishtigupta merged commit 08e5130 into main Mar 13, 2024
5 checks passed
@rishtigupta rishtigupta deleted the feat/phpcs branch March 13, 2024 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants