Problem/Motivation
While reviewing another Issue, I noticed that some files have coding standards violations.
Especially .module files and other files without the .php file extension.
Steps to reproduce
Check the code with php code sniffer using Drupal,Drupal Practice coding standards.
Proposed resolution
Resolve coding standard issues.
Issue fork cookies_addons-3425468
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
guido_sI applied coding standards to all files in the project and added a phpcs.xml for this project.
phpcs -v coookies_addonsresulted in 0 warnings and 0 errors.Project needs to be tested if nothing is broken after those code changes.
Comment #4
_shyStill experienced some coding standard issues. I'll take a look at it.
Comment #5
_shyFor now, I stack with ESlint check. We have
.eslintrc.jsonfile which is has the following line:"extends": "drupal"This causes the following error on the ESlint job:
This file does not strictly need to exist in contrib, because eslint config files placed further up in the directory structure will be merged and inherited. The top-level .eslintrc.json extends ./core/.eslintrc.json.
Comment #6
guido_sI couldn't get eslint checks running as intended.
It's a known issue with extending eslint configs.
https://www.drupal.org/project/gitlab_templates/issues/3438843
So for now I specified another .eslintrc.json to extend.
This leads to issues when working locally on the project as this .eslintrc.json can't be found there while not used in a complete drupal setup, but at least checks are passing now.
Should be refactored in the future if a solution is found in the mentioned issue.