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

WS2 1607: Investigate code linting and static analysis options to implement in before commiting. #49

Merged
merged 5 commits into from
Jun 13, 2023

Conversation

juanmitriatti
Copy link
Contributor

@juanmitriatti juanmitriatti commented Jun 2, 2023

Description

Investigate code linting and static analysis options to implement in before commiting.

Solution: Dependencies installed: "squizlabs/php_codesniffer=*", drupal/coder y sirbrillig/phpcs-changed. Then the pre-commit file was created, where the types of files to be taken into account are specified to verify that the changes to be committed meet the corresponding standards. Please, read the readme file in the scripts/ folder for further instructions.

Steps to install this code validation tool in your local :

  1. The 'pre-commit' file, located in the 'scripts/' directory, should be relocated to the './.git/hooks/' directory.
    Run the following command to make the hook executable:
chmod +x .git/hooks/pre-commit
  1. Please, ensure that PHP version 8.2.6 is installed on your system.

  2. As the final step, please execute the following command:

composer install

Steps to use this tool:

  1. Once you finish your implementation(code changes), please move your files to the staging area.
  2. When you commit your files, you may encounter errors if there are issues in your staged files. Also, you can run this validation manually by executing : ./.git/hooks/pre-commit (Files that needs to be evaluated must be in the staging area).
  3. Please fix the errors and commit your changes again.

Important note
Allowed file extensions
php,module,inc,install,test,profile,theme,css,info,txt & md

Links

Checklist

  • Design updates match Web Standards and Unity Design System
  • Solution is documented on the Jira ticket
  • QA steps to verify have been included on the Jira ticket
  • No new PHP or JS errors
  • No accessibility issues are introduced with this update
  • Added/updated README.md files, if relevant

Verified in browsers

  • Chrome
  • Safari
  • Firefox
  • Edge

@mlsamuelson
Copy link
Contributor

Visit Site

Created multidev environment pr-49 for webspark-ci.

@juanmitriatti juanmitriatti requested a review from a team June 5, 2023 22:47
@mlsamuelson
Copy link
Contributor

@juanmitriatti This will need to be updated since WS2-1519 was merged.

@mlsamuelson mlsamuelson merged commit 1730c6a into ws2-sprint-41 Jun 13, 2023
@mlsamuelson mlsamuelson deleted the WS2-1607 branch June 13, 2023 22:15
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