Command icon 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

dineshkumarbollu created an issue. See original summary.

dineshkumarbollu’s picture

Assigned: dineshkumarbollu » Unassigned
Status: Active » Needs review
StatusFileSize
new2.56 KB
chanderbhushan’s picture

StatusFileSize
new2.54 KB

Added patch for fix coding standards .

raveen_thakur51’s picture

I have reviewed patch #2. And it seems as per coding standards. Thank you.

avpaderno’s picture

Title: Coding standards » Fix the issues reported by phpcs
Priority: Normal » Minor
avpaderno’s picture

Status: Needs review » Needs work

I am reviewing the patch in comment #2.

+   * @param string $plugin_id
+   *   The plugin_id parameter.
+   * @param mixed $plugin_definition
+   *   The Plugin_definition parameter.

It is not how parameters are described. For example, there is no need to say that a parameter is... a parameter.

+   * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
+   *   The FeildDefintion service.

There are two typos.

soham sengupta’s picture

Status: Needs work » Needs review
StatusFileSize
new2.64 KB

Hi, I have updated the parameter comments.

chanderbhushan’s picture

In #3 patch I have fixed.

avpaderno’s picture

Status: Needs review » Needs work
-   * @var EntityTypeManagerInterface
+   * Entity Type Manager service.
+   *
+   * @var \Drupal\Core\Entity\EntityTypeManagerInterface
    */

In English, there are rules about which words are written capitalized. On Entity Type Manager only the first word is correctly spelled.
There is a missing article, in the short description.

+   * @param string $plugin_id
+   *   The plugin_id for the formatter.
+   * @param mixed $plugin_definition
+   *   The plugin implementation definition.

It is redundant to say that the $plugin_id parameter is the plugin_id of the formatter, since that is repeating the parameter name.
The correct description for those parameters can be seen in constructors like PluginBase::__construct(), for example.

+   * @param string $label
+   *   The formatter label display setting.

It is sufficient to say The formatter label.

    * @param array $third_party_settings
-   * @param EntityTypeManagerInterface $entity_type_manager
+   *   Any third party settings.
+   * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
+   *   The Entity type manager service.

Any is not necessary.
Entity is misspelled, since it is not at the beginning of the sentence (contrary to The).

akram khan’s picture

Status: Needs work » Needs review
StatusFileSize
new2.62 KB
new1.48 KB

addressed #9

a.aaronjake’s picture

Status: Needs review » Needs work

Hi @Akram Khan,

The patch you provided was applied successfully, but there is a file that has 2 errors reported. Please see below:

markdown_field_formatter git:(1.0.0-beta1) curl https://www.drupal.org/files/issues/2023-04-24/3355535-10.patch | patch -p1
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2687  100  2687    0     0  30198      0 --:--:-- --:--:-- --:--:-- 34448
patching file markdown_field_formatter.info.yml
patching file src/Plugin/Field/FieldFormatter/MarkdownFileFormatter.php
➜  markdown_field_formatter git:(1.0.0-beta1) ✗ cd ..
➜  contrib git:(master) ✗ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig markdown_field_formatter

FILE: /Users/PrometInterns/Demo-site/drupal-orgissue-v9/web/modules/contrib/markdown_field_formatter/src/Plugin/Field/FieldFormatter/MarkdownFileFormatter.php
--------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------------------------------------------------------------------------------------
 11 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is League\CommonMark\CommonMarkConverter.
 61 | ERROR | [x] Multi-line function declarations must have a trailing comma after the last parameter
--------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------------------------------------

Time: 134ms; Memory: 10MB

Kindly check

Thanks,
Jake

atul_ghate made their first commit to this issue’s fork.

atul_ghate’s picture

Status: Needs work » Needs review
a.aaronjake’s picture

Status: Needs review » Reviewed & tested by the community

Hi @atul_ghate,

The changes you committed on MR !1 was applied not-so successfully, but it fixed all errors.

markdown_field_formatter git:(1.0.0-beta1) curl https://git.drupalcode.org/project/markdown_field_formatter/-/merge_requests/1.diff | patch -p1
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  3664    0  3664    0     0  10441      0 --:--:-- --:--:-- --:--:-- 10682
patching file markdown_field_formatter.info.yml
Hunk #1 FAILED at 3.
1 out of 1 hunk FAILED -- saving rejects to file markdown_field_formatter.info.yml.rej
patching file src/Plugin/Field/FieldFormatter/MarkdownFileFormatter.php
➜  markdown_field_formatter git:(1.0.0-beta1) ✗ cd ..
➜  contrib git:(master) ✗ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig markdown_field_formatter
➜  contrib git:(master) ✗

Will now move this to RTBC

Thanks,
Jake

avpaderno’s picture

avpaderno’s picture

Issue summary: View changes

avpaderno changed the visibility of the branch 3355535-gitlab-ci-reports to hidden.

mourad-zitouni made their first commit to this issue’s fork.