Rebuild something cached by Drupal without doing a full cache clear.

Fairly simple module that provides a plug-in manager, Drush commands, and an optional UI sub-module to clear/rebuild various things without having to remember what service does what and with what method name.

Project link

https://www.drupal.org/project/rebuilder

Git instructions

git clone --branch '1.x' https://git.drupalcode.org/project/rebuilder.git

Comments

Ambient.Impact created an issue. See original summary.

avpaderno’s picture

Thank you for applying!
Remember to change status, as the currently used one means the project is not yet ready to be reviewed.

Is the account used to create this application a shared account?

ambient.impact’s picture

Status: Active » Needs review

@apaderno Whoops, fixed. 😅 This account is my own personal account, so not a shared account.

LuongGiap’s picture

Status: Needs review » Needs work

Hi @Ambient.Impact
I review Drupal coding standards for branch 1.x. You can check and fix errors.

$ ./vendor/bin/phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml web/modules/contrib/rebuilder

FILE: C:\Ampps\www\Test-Drupal-Buiding\web\modules\contrib\rebuilder\modules\rebuilder_ui\src\Form\RebuilderRunForm.php
-----------------------------------------------------------------------------------------------------------------------
FOUND 13 ERRORS AFFECTING 12 LINES
-----------------------------------------------------------------------------------------------------------------------
   1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
   1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
  30 | ERROR | [ ] Parameter tags must be grouped together in a doc comment
  33 | ERROR | [ ] Parameter tags must be grouped together in a doc comment
  37 | ERROR | [x] Expected 1 space between type hint and argument "$messenger"; 8 found
  39 | ERROR | [x] Expected 1 space between type hint and argument "$stringTranslation"; 6 found
  41 | ERROR | [x] Equals sign not aligned with surrounding assignments; expected 9 spaces but found 10 spaces
  42 | ERROR | [x] Equals sign not aligned with surrounding assignments; expected 2 spaces but found 3 spaces
  43 | ERROR | [x] Equals sign not aligned with surrounding assignments; expected 1 space but found 2 spaces
  62 | ERROR | [x] Expected 1 blank line after function; 2 found
 119 | ERROR | [ ] Parameter tags must be grouped together in a doc comment
 123 | ERROR | [x] Multi-line function declarations must define one parameter per line
 138 | ERROR | [x] Expected newline after closing brace
-----------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 10 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------


FILE: C:\Ampps\www\Test-Drupal-Buiding\web\modules\contrib\rebuilder\readme.md
------------------------------------------------------------------------------
FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 5 LINES
------------------------------------------------------------------------------
  1 | WARNING | Line exceeds 80 characters; contains 143 characters
  7 | WARNING | Line exceeds 80 characters; contains 185 characters
  9 | WARNING | Line exceeds 80 characters; contains 121 characters
 11 | WARNING | Line exceeds 80 characters; contains 156 characters
 33 | WARNING | Line exceeds 80 characters; contains 174 characters
------------------------------------------------------------------------------


FILE: C:\Ampps\www\Test-Drupal-Buiding\web\modules\contrib\rebuilder\src\Annotation\Rebuilder.php
-------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------
 1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
-------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------


FILE: C:\Ampps\www\Test-Drupal-Buiding\web\modules\contrib\rebuilder\src\Commands\ListCommand.php
-------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 3 LINES
-------------------------------------------------------------------------------------------------
  1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
  1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
 10 | ERROR | [x] Doc comment short description must start with a capital letter
 38 | ERROR | [ ] Description for the @return value is missing
-------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------


FILE: C:\Ampps\www\Test-Drupal-Buiding\web\modules\contrib\rebuilder\src\Commands\RunCommand.php
------------------------------------------------------------------------------------------------
FOUND 7 ERRORS AFFECTING 6 LINES
------------------------------------------------------------------------------------------------
  1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
  1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
 10 | ERROR | [x] Doc comment short description must start with a capital letter
 33 | ERROR | [ ] Parameter $options is not described in comment
 40 | ERROR | [ ] Parameter tags must be defined first in a doc comment
 52 | ERROR | [x] Multi-line function declarations must define one parameter per line
 64 | ERROR | [x] Expected newline after closing brace
------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------


FILE: C:\Ampps\www\Test-Drupal-Buiding\web\modules\contrib\rebuilder\src\Plugin\Rebuilder\Asset.php
----------------------------------------------------------------------------------------------------
FOUND 18 ERRORS AND 1 WARNING AFFECTING 13 LINES
----------------------------------------------------------------------------------------------------
   1 | ERROR   | [x] The PHP open tag must be followed by exactly one blank line
   1 | ERROR   | [x] End of line character is invalid; expected "\n" but found "\r\n"
  10 | WARNING | [x] Unused use statement
  62 | ERROR   | [ ] Parameter $configuration is not described in comment
  62 | ERROR   | [ ] Parameter $pluginId is not described in comment
  62 | ERROR   | [ ] Parameter $pluginDefinition is not described in comment
  62 | ERROR   | [ ] Parameter $stringTranslation is not described in comment
  68 | ERROR   | [ ] Parameter tags must be grouped together in a doc comment
  71 | ERROR   | [ ] Parameter tags must be grouped together in a doc comment
  74 | ERROR   | [ ] Parameter tags must be grouped together in a doc comment
  77 | ERROR   | [ ] Parameter tags must be grouped together in a doc comment
  81 | ERROR   | [x] Multi-line function declarations must define one parameter per line
  81 | ERROR   | [x] Multi-line function declarations must define one parameter per line
  82 | ERROR   | [x] Expected 1 space between type hint and argument "$stringTranslation"; 14 found
  85 | ERROR   | [x] Expected 1 space between type hint and argument "$time"; 21 found
  86 | ERROR   | [x] Expected 1 space between type hint and argument "$libraryDiscovery"; 9 found
  87 | ERROR   | [x] Expected 1 space between type hint and argument "$state"; 20 found
 108 | ERROR   | [x] Multi-line function declarations must define one parameter per line
 108 | ERROR   | [x] Multi-line function declarations must define one parameter per line
----------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 11 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------


FILE: C:\Ampps\www\Test-Drupal-Buiding\web\modules\contrib\rebuilder\src\Plugin\Rebuilder\Container.php
-------------------------------------------------------------------------------------------------------
FOUND 11 ERRORS AND 2 WARNINGS AFFECTING 7 LINES
-------------------------------------------------------------------------------------------------------
  1 | ERROR   | [x] The PHP open tag must be followed by exactly one blank line
  1 | ERROR   | [x] End of line character is invalid; expected "\n" but found "\r\n"
  7 | WARNING | [x] Unused use statement
 28 | ERROR   | [ ] Parameter $configuration is not described in comment
 28 | ERROR   | [ ] Parameter $pluginId is not described in comment
 28 | ERROR   | [ ] Parameter $pluginDefinition is not described in comment
 28 | ERROR   | [ ] Parameter $stringTranslation is not described in comment
 35 | ERROR   | [x] Multi-line function declarations must define one parameter per line
 35 | ERROR   | [x] Multi-line function declarations must define one parameter per line
 36 | ERROR   | [x] Expected 1 space between type hint and argument "$stringTranslation"; 2 found
 54 | ERROR   | [x] Multi-line function declarations must define one parameter per line
 54 | ERROR   | [x] Multi-line function declarations must define one parameter per line
 73 | WARNING | [x] There must be no blank line following an inline comment
-------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 9 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------


FILE: C:\Ampps\www\Test-Drupal-Buiding\web\modules\contrib\rebuilder\src\Plugin\Rebuilder\Library.php
-----------------------------------------------------------------------------------------------------
FOUND 11 ERRORS AND 1 WARNING AFFECTING 6 LINES
-----------------------------------------------------------------------------------------------------
  1 | ERROR   | [x] The PHP open tag must be followed by exactly one blank line
  1 | ERROR   | [x] End of line character is invalid; expected "\n" but found "\r\n"
  7 | WARNING | [x] Unused use statement
 31 | ERROR   | [ ] Parameter $configuration is not described in comment
 31 | ERROR   | [ ] Parameter $pluginId is not described in comment
 31 | ERROR   | [ ] Parameter $pluginDefinition is not described in comment
 31 | ERROR   | [ ] Parameter $stringTranslation is not described in comment
 38 | ERROR   | [x] Multi-line function declarations must define one parameter per line
 38 | ERROR   | [x] Multi-line function declarations must define one parameter per line
 39 | ERROR   | [x] Expected 1 space between type hint and argument "$stringTranslation"; 6 found
 57 | ERROR   | [x] Multi-line function declarations must define one parameter per line
 57 | ERROR   | [x] Multi-line function declarations must define one parameter per line
-----------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 8 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------


FILE: C:\Ampps\www\Test-Drupal-Buiding\web\modules\contrib\rebuilder\src\Plugin\Rebuilder\Plugin.php
----------------------------------------------------------------------------------------------------
FOUND 14 ERRORS AND 2 WARNINGS AFFECTING 10 LINES
----------------------------------------------------------------------------------------------------
   1 | ERROR   | [x] The PHP open tag must be followed by exactly one blank line
   1 | ERROR   | [x] End of line character is invalid; expected "\n" but found "\r\n"
   6 | WARNING | [x] Unused use statement
  43 | ERROR   | [ ] Parameter $configuration is not described in comment
  43 | ERROR   | [ ] Parameter $pluginId is not described in comment
  43 | ERROR   | [ ] Parameter $pluginDefinition is not described in comment
  43 | ERROR   | [ ] Parameter $stringTranslation is not described in comment
  50 | ERROR   | [x] Multi-line function declarations must define one parameter per line
  50 | ERROR   | [x] Multi-line function declarations must define one parameter per line
  51 | ERROR   | [x] Expected 1 space between type hint and argument "$stringTranslation"; 2 found
  52 | ERROR   | [x] Expected 1 space between type hint and argument "$container"; 4 found
  69 | ERROR   | [x] Multi-line function declarations must define one parameter per line
  69 | ERROR   | [x] Multi-line function declarations must define one parameter per line
 133 | WARNING | [x] A comma should follow the last multiline array item. Found: )
 136 | ERROR   | [x] Expected newline after closing brace
 146 | ERROR   | [ ] Comment indentation error, expected only 1 spaces
----------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 11 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------


FILE: C:\Ampps\www\Test-Drupal-Buiding\web\modules\contrib\rebuilder\src\Plugin\Rebuilder\RebuilderBase.php
-----------------------------------------------------------------------------------------------------------
FOUND 11 ERRORS AND 1 WARNING AFFECTING 9 LINES
-----------------------------------------------------------------------------------------------------------
  1 | ERROR   | [x] The PHP open tag must be followed by exactly one blank line
  1 | ERROR   | [x] End of line character is invalid; expected "\n" but found "\r\n"
 10 | WARNING | [x] Unused use statement
 33 | ERROR   | [ ] Parameter tags must be grouped together in a doc comment
 36 | ERROR   | [ ] Parameter tags must be grouped together in a doc comment
 40 | ERROR   | [ ] Parameter tags must be grouped together in a doc comment
 44 | ERROR   | [x] Multi-line function declarations must define one parameter per line
 44 | ERROR   | [x] Multi-line function declarations must define one parameter per line
 59 | ERROR   | [x] Multi-line function declarations must define one parameter per line
 59 | ERROR   | [x] Multi-line function declarations must define one parameter per line
 83 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 4
 84 | ERROR   | [x] Expected newline after closing brace
-----------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 9 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------


FILE: C:\Ampps\www\Test-Drupal-Buiding\web\modules\contrib\rebuilder\src\Plugin\Rebuilder\RebuilderInterface.php
----------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------
 1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
----------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------


FILE: C:\Ampps\www\Test-Drupal-Buiding\web\modules\contrib\rebuilder\src\Plugin\Rebuilder\Router.php
----------------------------------------------------------------------------------------------------
FOUND 11 ERRORS AND 1 WARNING AFFECTING 6 LINES
----------------------------------------------------------------------------------------------------
  1 | ERROR   | [x] The PHP open tag must be followed by exactly one blank line
  1 | ERROR   | [x] End of line character is invalid; expected "\n" but found "\r\n"
  7 | WARNING | [x] Unused use statement
 28 | ERROR   | [ ] Parameter $configuration is not described in comment
 28 | ERROR   | [ ] Parameter $pluginId is not described in comment
 28 | ERROR   | [ ] Parameter $pluginDefinition is not described in comment
 28 | ERROR   | [ ] Parameter $stringTranslation is not described in comment
 35 | ERROR   | [x] Multi-line function declarations must define one parameter per line
 35 | ERROR   | [x] Multi-line function declarations must define one parameter per line
 36 | ERROR   | [x] Expected 1 space between type hint and argument "$stringTranslation"; 2 found
 54 | ERROR   | [x] Multi-line function declarations must define one parameter per line
 54 | ERROR   | [x] Multi-line function declarations must define one parameter per line
----------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 8 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------


FILE: C:\Ampps\www\Test-Drupal-Buiding\web\modules\contrib\rebuilder\src\Plugin\Rebuilder\Schema.php
----------------------------------------------------------------------------------------------------
FOUND 11 ERRORS AND 1 WARNING AFFECTING 6 LINES
----------------------------------------------------------------------------------------------------
  1 | ERROR   | [x] The PHP open tag must be followed by exactly one blank line
  1 | ERROR   | [x] End of line character is invalid; expected "\n" but found "\r\n"
  7 | WARNING | [x] Unused use statement
 28 | ERROR   | [ ] Parameter $configuration is not described in comment
 28 | ERROR   | [ ] Parameter $pluginId is not described in comment
 28 | ERROR   | [ ] Parameter $pluginDefinition is not described in comment
 28 | ERROR   | [ ] Parameter $stringTranslation is not described in comment
 35 | ERROR   | [x] Multi-line function declarations must define one parameter per line
 35 | ERROR   | [x] Multi-line function declarations must define one parameter per line
 36 | ERROR   | [x] Expected 1 space between type hint and argument "$stringTranslation"; 8 found
 54 | ERROR   | [x] Multi-line function declarations must define one parameter per line
 54 | ERROR   | [x] Multi-line function declarations must define one parameter per line
----------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 8 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------


FILE: C:\Ampps\www\Test-Drupal-Buiding\web\modules\contrib\rebuilder\src\Plugin\Rebuilder\Twig.php
--------------------------------------------------------------------------------------------------
FOUND 12 ERRORS AND 1 WARNING AFFECTING 7 LINES
--------------------------------------------------------------------------------------------------
  1 | ERROR   | [x] The PHP open tag must be followed by exactly one blank line
  1 | ERROR   | [x] End of line character is invalid; expected "\n" but found "\r\n"
  7 | WARNING | [x] Unused use statement
 28 | ERROR   | [ ] Parameter $configuration is not described in comment
 28 | ERROR   | [ ] Parameter $pluginId is not described in comment
 28 | ERROR   | [ ] Parameter $pluginDefinition is not described in comment
 28 | ERROR   | [ ] Parameter $stringTranslation is not described in comment
 35 | ERROR   | [x] Multi-line function declarations must define one parameter per line
 35 | ERROR   | [x] Multi-line function declarations must define one parameter per line
 36 | ERROR   | [x] Expected 1 space between type hint and argument "$stringTranslation"; 2 found
 37 | ERROR   | [x] Expected 1 space between type hint and argument "$twigEnvironment"; 7 found
 54 | ERROR   | [x] Multi-line function declarations must define one parameter per line
 54 | ERROR   | [x] Multi-line function declarations must define one parameter per line
--------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 9 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------


FILE: C:\Ampps\www\Test-Drupal-Buiding\web\modules\contrib\rebuilder\src\PluginManager\RebuilderManager.php
-----------------------------------------------------------------------------------------------------------
FOUND 8 ERRORS AND 1 WARNING AFFECTING 8 LINES
-----------------------------------------------------------------------------------------------------------
   1 | ERROR   | [x] The PHP open tag must be followed by exactly one blank line
   1 | ERROR   | [x] End of line character is invalid; expected "\n" but found "\r\n"
  11 | WARNING | [x] Unused use statement
  27 | ERROR   | [ ] Parameter tags must be grouped together in a doc comment
  30 | ERROR   | [ ] Parameter tags must be grouped together in a doc comment
  34 | ERROR   | [x] Expected 1 space between type hint and argument "$namespaces"; 12 found
  35 | ERROR   | [x] Expected 1 space between type hint and argument "$cacheBackend"; 3 found
  36 | ERROR   | [x] Expected 1 space between type hint and argument "$moduleHandler"; 2 found
 103 | ERROR   | [x] Multi-line function declarations must define one parameter per line
-----------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------


FILE: C:\Ampps\www\Test-Drupal-Buiding\web\modules\contrib\rebuilder\src\PluginManager\RebuilderManagerInterface.php
--------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------------------------------------------------
  1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
  1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
 18 | ERROR | [ ] Parameter tags must be grouped together in a doc comment
 25 | ERROR | [x] Multi-line function declarations must define one parameter per line
--------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------


FILE: C:\Ampps\www\Test-Drupal-Buiding\web\modules\contrib\rebuilder\tests\src\Kernel\RebuilderManagerTest.php
--------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------
 1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
--------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------

Time: 3.09 secs; Memory: 10MB
ambient.impact’s picture

Status: Needs work » Needs review

@LuongGiap I just pushed a bunch of changes to the 1.x branch so you should be able to re-run phpcs. I also added a phpcs.xml to the repository with a few overrides, along with comments explaining why:

./vendor/bin/phpcs --standard=web/modules/contrib/rebuilder/phpcs.xml

If you look through my code, you'll see it's very well documented and follows the spirit of the coding standards, even though it diverges on a few sniffs.

LuongGiap’s picture

Hi @Ambient.Impact
I was check code, thank you!

cmlara’s picture

Comment #5 I believe needs a more experienced reviewers approval so placing this comment with bold text to ensure an approved reviewer sees this when parsing the history.

The policy as I understand it is that a project can not be failed on code-sniffs except for 'total disregard'. The reason for disabling appears to be around an opinion on readability and not a technical requirement to do so.

Is disabling sniffs without a technical justification classified as 'total disregard' of the coding standards?

ambient.impact’s picture

@LuongGiap Thanks!

@cmlara Thanks for the thoughtful reply. Ultimately it's up to reviewers to decide this, but I feel that my code follows the spirit of the guidelines:

Although sticking hard and fast to the standards is not an absolute requirement, plain sloppy and poorly presented code is not accepted. Try to follow the standard if at all possible and try to make the code clean and readable. If a reviewer is having a hard time reading your code it is likely that a number of other people will too.

My code is very readable, with almost all of my deviations from the coding standards (relatively minor as they are) for better readability as you mention. See the phpcs.xml comments for my reasoning.

avpaderno’s picture

Assigned: Unassigned » avpaderno
Status: Needs review » Fixed

Thank you for your contribution! I am going to update your account.

These are some recommended readings to help with excellent maintainership:

You can find more contributors chatting on the IRC #drupal-contribute channel. So, come hang out and stay involved.
Thank you, also, for your patience with the review process.
Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

Thank you to all the reviewers.

ambient.impact’s picture

@apaderno Awesome, thanks! 🚀

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.