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

[generate:entity:content] Generated Entity files does not honor coding standards #3985

Closed
csegarra opened this issue Nov 27, 2018 · 0 comments · Fixed by #4031
Closed

[generate:entity:content] Generated Entity files does not honor coding standards #3985

csegarra opened this issue Nov 27, 2018 · 0 comments · Fixed by #4031

Comments

@csegarra
Copy link
Contributor

csegarra commented Nov 27, 2018

Problem/Motivation

The code generated for the Entity and the utility classes (Storage, Forms, etc.) have some errors regarding the Drupal coding standards:

  • Expected 1 newline at end of file; 2 found on the three links files.
  • Expected 1 space(s) before asterisk; 0 found on .module file.
  • Various CS validation errors on the Controller. In also uses deprecated EntityManager.
  • Expected 1 blank line before function; 2 found on the ListBuilder.
  • Expected 1 blank line after function; 0 found on the StorageInterface.
  • Unused use statement on Config Entity RouteProvider.
  • Various CS validation errors on the Entity class.

This issue may be related with #2166.

How to reproduce

Using Drupal Console 1.8 create a custom module:

drupal generate:module \
  --module "CS Test" \
  --machine-name cs_test \
  --module-path modules/custom \
  --description "Code Styling test module" \
  -q

And then add a Content Entity:

drupal generate:entity:content \
  --module cs_test \
  --has-bundles

Solution

The templates should be modified to follow the Drupal coding standards.

csegarra added a commit to gcoop-libre/drupal-console that referenced this issue Nov 27, 2018
csegarra added a commit to gcoop-libre/drupal-console that referenced this issue Nov 27, 2018
csegarra added a commit to gcoop-libre/drupal-console that referenced this issue Nov 27, 2018
csegarra added a commit to gcoop-libre/drupal-console that referenced this issue Nov 27, 2018
csegarra added a commit to gcoop-libre/drupal-console that referenced this issue Nov 27, 2018
csegarra added a commit to gcoop-libre/drupal-console that referenced this issue Nov 27, 2018
csegarra added a commit to gcoop-libre/drupal-console that referenced this issue Nov 27, 2018
enzolutions pushed a commit that referenced this issue May 11, 2019
…4031)

* REL #3985: Correct entity link templates

* REL #3985: Correct Controller CS

* REL #3985: Correct hook docblock

* REL #3985: Correct entity forms CS

* REL #3985: Correct StorageInterface CS

* REL #3985: Correct Entity Interface CS

* FIX #3985: Remove unnecessary use statement from the entity
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 a pull request may close this issue.

1 participant