[META] PHPCS errors on code

Created on 22 December 2021, about 3 years ago
Updated 7 June 2024, 7 months ago

Problem/Motivation

I noticed there was a long list of errors when running the phpcs check on the module (4928 errors and 144 warnings). You can see the file attached bellow (I didn't copied the text here since it's too long).

Steps to reproduce

Open the Gutenberg module directory on your terminal and run the command: phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml . > phpcs_gutenber_all_errors.txt

Proposed resolution

Fix either automatically or manually all errors and create patches accordingly.

Remaining tasks

As the list of errors is too long I'll divide in sub-tasks, one for each folder on the root. It will make creating patches and reviewing code easier.

  • src/

The Config directory phpcs issues in gutenberg module are handled in this issue Config Thread ā†’
The CSS & Scripts phpcs issues in gutenberg module are handled in this issue CSS & Scripts Thread šŸ“Œ Fix the issues reported by phpcs Postponed
The Modules directory phpcs issues in gutenberg module are handled in this issue Modules Thread šŸ“Œ Fix the issues reported by phpcs in the modules directory Needs review
The Vendor directory phpcs issues in gutenberg module are handled in this issue Vendor Thread šŸ“Œ Fix the issues reported by phpcs Needs work

šŸ“Œ Task
Status

Needs work

Version

2.0

Component

Code

Created by

šŸ‡§šŸ‡·Brazil andregp

Live updates comments and jobs are added and updated live.
  • Needs reroll

    The patch will have to be re-rolled with new suggestions/changes described in the comments in the issue.

  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • šŸ‡®šŸ‡³India indrapatil Bangalore

    I will test this patch

  • šŸ‡®šŸ‡³India indrapatil Bangalore

    This patch failed.

  • Issue was unassigned.
  • šŸ‡®šŸ‡³India indrapatil Bangalore
  • Pipeline finished with Skipped
    over 1 year ago
    #26847
  • Pipeline finished with Skipped
    about 1 year ago
    #50330
  • Status changed to Needs work about 1 year ago
  • šŸ‡³šŸ‡“Norway eiriksm Norway

    If someone could create a merge request for this, so we have an up to date patch there, that would be great, thanks šŸ™

  • Pipeline finished with Skipped
    about 1 year ago
    #66705
  • Pipeline finished with Skipped
    about 1 year ago
    #68706
  • Assigned to realsp
  • šŸ‡®šŸ‡³India realsp

    I'll create the MR for this patch

  • šŸ‡®šŸ‡³India realsp

    The Config directory phpcs issues in gutenberg module are handled in this issue Config Thread ā†’
    The CSS & Scripts phpcs issues in gutenberg module are handled in this issue CSS & Scripts Thread šŸ“Œ Fix the issues reported by phpcs Postponed
    The Modules directory phpcs issues in gutenberg module are handled in this issue Modules Thread šŸ“Œ Fix the issues reported by phpcs in the modules directory Needs review
    The Vendor directory phpcs issues in gutenberg module are handled in this issue Vendor Thread šŸ“Œ Fix the issues reported by phpcs Needs work

    In this issue, I'm fixing src/ directory phpcs issues

  • Merge request !88[META] PHPCS errors on code ā†’ (Open) created by realsp
  • Pipeline finished with Failed
    about 1 year ago
    #73560
  • šŸ‡®šŸ‡³India realsp

    realsp ā†’ changed the visibility of the branch 8.x-2.x to hidden.

  • Status changed to Needs review about 1 year ago
  • Issue was unassigned.
  • First commit to issue fork.
  • Pipeline finished with Success
    12 months ago
    #80653
  • Pipeline finished with Failed
    12 months ago
    Total: 163s
    #83713
  • Pipeline finished with Success
    12 months ago
    Total: 188s
    #84051
  • Pipeline finished with Success
    12 months ago
    Total: 158s
    #84053
  • Pipeline finished with Failed
    11 months ago
    Total: 46s
    #92532
  • Pipeline finished with Failed
    11 months ago
    Total: 879s
    #92533
  • Pipeline finished with Failed
    11 months ago
    Total: 1077s
    #92557
  • Pipeline finished with Success
    11 months ago
    Total: 1046s
    #92563
  • Pipeline finished with Success
    11 months ago
    Total: 1093s
    #92566
  • Pipeline finished with Failed
    11 months ago
    Total: 287s
    #108547
  • Pipeline finished with Success
    11 months ago
    Total: 193s
    #108588
  • Pipeline finished with Success
    11 months ago
    Total: 811s
    #111193
  • Pipeline finished with Success
    11 months ago
    Total: 756s
    #111198
  • Pipeline finished with Success
    11 months ago
    Total: 800s
    #111211
  • Pipeline finished with Canceled
    11 months ago
    Total: 227s
    #111321
  • Pipeline finished with Success
    11 months ago
    Total: 754s
    #111330
  • Pipeline finished with Success
    10 months ago
    Total: 693s
    #114320
  • Pipeline finished with Success
    10 months ago
    Total: 890s
    #115038
  • Pipeline finished with Failed
    10 months ago
    #126643
  • Pipeline finished with Failed
    10 months ago
    Total: 226s
    #126654
  • Pipeline finished with Success
    10 months ago
    Total: 180s
    #126659
  • Pipeline finished with Success
    10 months ago
    Total: 153s
    #127100
  • Pipeline finished with Success
    10 months ago
    Total: 782s
    #129956
  • Pipeline finished with Failed
    10 months ago
    Total: 177s
    #138046
  • Pipeline finished with Success
    9 months ago
    Total: 229s
    #142442
  • Pipeline finished with Success
    8 months ago
    Total: 284s
    #166521
  • Pipeline finished with Success
    8 months ago
    Total: 476s
    #174545
  • Pipeline finished with Success
    8 months ago
    Total: 516s
    #174553
  • Status changed to Needs work 7 months ago
  • šŸ‡µšŸ‡­Philippines cleavinjosh

    Hi @marcofernandes,

    I tried to apply MR!88 but I encountered some errors.

    āžœ  gutenberg git:(8.x-2.9) āœ— curl https://git.drupalcode.org/project/gutenberg/-/merge_requests/88.diff | git apply -v
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 74951    0 74951    0     0   181k      0 --:--:-- --:--:-- --:--:--  181k
    Checking patch gutenberg.services.yml...
    Checking patch src/Ajax/UpdateMediaEntitiesCommand.php...
    Checking patch src/BlockProcessor/DuotoneProcessor.php...
    Checking patch src/BlockProcessor/OEmbedProcessor.php...
    Checking patch src/BlockProcessor/ReusableBlockProcessor.php...
    Checking patch src/BlocksLibraryManager.php...
    Checking patch src/BlocksRendererHelper.php...
    Checking patch src/Controller/BlocksController.php...
    Checking patch src/Controller/MediaController.php...
    Checking patch src/Controller/ReusableBlocksController.php...
    Checking patch src/Controller/SearchController.php...
    Checking patch src/Controller/UtilsController.php...
    Checking patch src/DataProvider/BaseDataProvider.php...
    Checking patch src/DataProvider/FileEntityDataProvider.php...
    Checking patch src/DataProvider/MediaEntityDataProvider.php...
    Checking patch src/Discovery/BlockJsonDiscovery.php...
    Checking patch src/Form/BlockSettingsForm.php...
    Checking patch src/GutenbergElementInfoAlter.php...
    Checking patch src/GutenbergLibraryManager.php...
    Checking patch src/GutenbergMediaLibraryUiBuilder.php...
    Checking patch src/GutenbergPluginManager.php...
    Checking patch src/MappingFieldsHelper.php...
    error: while searching for:
    
        // Fetch only blocks with mapping fields.
        $block_parser = new BlockParser();
        $blocks = $block_parser->parse($field_content, [$this, 'filterMappingFieldsBlock']);
    
        // Let's build the field's array of values.
        $fields = [];
    
    error: patch failed: src/MappingFieldsHelper.php:76
    error: src/MappingFieldsHelper.php: patch does not apply
    Checking patch src/MediaSelectionProcessor/MediaSelectionProcessorInterface.php...
    Checking patch src/OEmbedResolver.php...
    Checking patch src/Parser/BlockParser.php...
    Checking patch src/Parser/BlockParserFrame.php...
    Checking patch src/Plugin/Editor/Gutenberg.php...
    Checking patch src/Plugin/Filter/GutenbergFilter.php...
    Checking patch src/Plugin/GutenbergPlugin/DrupalImage.php...
    Checking patch src/ScanDir.php...
    Checking patch src/Service/MediaService.php...
    error: while searching for:
    use Drupal\Core\Entity\EntityTypeManagerInterface;
    use Drupal\Core\Extension\ModuleHandlerInterface;
    use Drupal\Core\Render\RendererInterface;
    use Drupal\editor\Entity\Editor;
    use Drupal\file\FileInterface;
    use Drupal\gutenberg\DataProvider\EntityDataProviderManager;
    
    error: patch failed: src/Service/MediaService.php:8
    error: src/Service/MediaService.php: patch does not apply
    Checking patch src/TinyColor.php...
    āžœ  gutenberg git:(8.x-2.9) āœ—

    Please check and advise.
    Thank you.

  • Pipeline finished with Skipped
    7 months ago
    #193920
  • Pipeline finished with Failed
    7 months ago
    Total: 227s
    #195927
  • Pipeline finished with Success
    7 months ago
    Total: 217s
    #195929
  • Pipeline finished with Success
    7 months ago
    Total: 280s
    #195941
  • Pipeline finished with Success
    7 months ago
    Total: 257s
    #195943
  • Pipeline finished with Success
    7 months ago
    Total: 277s
    #197408
  • Pipeline finished with Success
    7 months ago
    Total: 251s
    #197496
  • Pipeline finished with Success
    7 months ago
    Total: 255s
    #197502
  • Pipeline finished with Success
    7 months ago
    Total: 223s
    #197561
  • Pipeline finished with Success
    7 months ago
    Total: 246s
    #197564
  • Pipeline finished with Skipped
    7 months ago
    #197566
  • Pipeline finished with Skipped
    7 months ago
    #203507
  • Pipeline finished with Success
    7 months ago
    Total: 1077s
    #211771
  • Pipeline finished with Success
    7 months ago
    Total: 1009s
    #211813
  • Pipeline finished with Success
    6 months ago
    #218041
  • Pipeline finished with Success
    6 months ago
    Total: 243s
    #218053
  • Pipeline finished with Failed
    6 months ago
    #221634
  • Pipeline finished with Failed
    6 months ago
    #221640
  • Pipeline finished with Manual
    6 months ago
    #221641
  • Pipeline finished with Failed
    6 months ago
    #221653
  • Pipeline finished with Failed
    6 months ago
    #221676
  • Pipeline finished with Manual
    6 months ago
    #221682
  • Pipeline finished with Manual
    6 months ago
    #221690
  • Pipeline finished with Manual
    6 months ago
    #221715
  • Pipeline finished with Skipped
    6 months ago
    #228192
  • Pipeline finished with Success
    6 months ago
    #234194
  • Pipeline finished with Success
    6 months ago
    #234235
  • Pipeline finished with Success
    6 months ago
    Total: 202s
    #239488
  • Pipeline finished with Failed
    6 months ago
    Total: 388s
    #240814
  • Pipeline finished with Failed
    6 months ago
    Total: 333s
    #240888
  • Pipeline finished with Success
    6 months ago
    Total: 405s
    #240956
  • Pipeline finished with Success
    6 months ago
    Total: 504s
    #240976
  • Pipeline finished with Success
    5 months ago
    Total: 364s
    #253238
  • Pipeline finished with Success
    5 months ago
    Total: 266s
    #264827
  • Pipeline finished with Success
    5 months ago
    Total: 153s
    #265262
  • Pipeline finished with Success
    5 months ago
    Total: 135s
    #266368
  • Pipeline finished with Failed
    4 months ago
    Total: 161s
    #288360
  • Pipeline finished with Success
    4 months ago
    Total: 147s
    #288363
  • Pipeline finished with Canceled
    4 months ago
    Total: 86s
    #288365
  • Pipeline finished with Success
    4 months ago
    Total: 157s
    #288366
  • Pipeline finished with Success
    4 months ago
    Total: 148s
    #288369
  • Pipeline finished with Success
    4 months ago
    Total: 204s
    #291636
  • Pipeline finished with Success
    4 months ago
    Total: 189s
    #291642
  • Pipeline finished with Success
    4 months ago
    Total: 190s
    #291651
  • Pipeline finished with Success
    4 months ago
    Total: 215s
    #293274
  • Pipeline finished with Success
    4 months ago
    Total: 192s
    #293341
  • Pipeline finished with Failed
    4 months ago
    Total: 144s
    #293362
  • Pipeline finished with Success
    4 months ago
    Total: 180s
    #293369
  • Pipeline finished with Success
    3 months ago
    Total: 505s
    #314803
  • Pipeline finished with Success
    3 months ago
    Total: 151s
    #316897
  • Pipeline finished with Failed
    3 months ago
    Total: 46s
    #324197
  • Pipeline finished with Success
    2 months ago
    Total: 157s
    #326816
  • Pipeline finished with Success
    2 months ago
    Total: 140s
    #333179
  • Pipeline finished with Success
    about 1 month ago
    Total: 206s
    #358967
  • Pipeline finished with Success
    about 1 month ago
    Total: 3775s
    #363548
Production build 0.71.5 2024