- Issue created by @Shiv_Sharma
- Assigned to kpoornima
- Issue was unassigned.
- Status changed to Needs review
over 1 year ago 10:14am 8 August 2023 - Status changed to Needs work
over 1 year ago 10:39am 8 August 2023 - ๐ฎ๐ณIndia Nishant
I have checkout 3379900-phpcs-errors this branch and run the above command, I saw some phpcs cs error, I am posting below.
FILE: /var/www/html/web/modules/live_weather/src/Plugin/Block/LiveWeatherBlock.php ----------------------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE ----------------------------------------------------------------------------------------------------------------------------------- 9 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Config\ConfigFactoryInterface. ----------------------------------------------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY ----------------------------------------------------------------------------------------------------------------------------------- FILE: /var/www/html/web/modules/live_weather/src/Form/LiveWeatherDeleteForm.php ----------------------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE ----------------------------------------------------------------------------------------------------------------------------------- 6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Config\ConfigFactoryInterface. ----------------------------------------------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY ----------------------------------------------------------------------------------------------------------------------------------- FILE: /var/www/html/web/modules/live_weather/src/Form/LiveWeatherForm.php ----------------------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE ----------------------------------------------------------------------------------------------------------------------------------- 6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Config\ConfigFactoryInterface. ----------------------------------------------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY ----------------------------------------------------------------------------------------------------------------------------------- FILE: /var/www/html/web/modules/live_weather/src/Controller/LiveWeatherController.php ----------------------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE ----------------------------------------------------------------------------------------------------------------------------------- 6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Config\ConfigFactoryInterface. ----------------------------------------------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY ----------------------------------------------------------------------------------------------------------------------------------- FILE: /var/www/html/web/modules/live_weather/src/LiveWeather.php ----------------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE ----------------------------------------------------------------------------------------------------------------------------- 6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Component\Serialization\Json. ----------------------------------------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
- Status changed to Needs review
over 1 year ago 7:36am 9 August 2023 - Status changed to RTBC
over 1 year ago 7:54am 9 August 2023 - ๐ฎ๐ณIndia aayushDrupal
Hi @Shreya_th,
I have tested your patch and found no errors. I've attached a screenshot for your reference.These are the steps I followed:
1. Took clone from git version 3.0.0 in drupal 10.1.x
2. Ran this command:
./vendor/bin/phpcs --standard="Drupal,DrupalPractice" --extensions="php,module,inc,install,test,profile,theme,md,yml" modules/contrib/live_weather/
3. Applied patch and again ran phpcs command.
I found no error. Moving it to RTBC.
- Status changed to Needs work
about 1 year ago 10:52am 17 October 2023 - ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
public function submitForm(array &$form, FormStateInterface $form_state) { - parent::submitForm($form, $form_state); + // parent::submitForm($form, $form_state);. }
If a method is merely calling the parent method, that method can be removed. There is no need to comment out the code.
protected $httpClient; - /** * A logger instance. * * @var \Psr\Log\LoggerInterface */ protected $logger; - /** * The configuration factory service. *
Between a line defining a class property and the comment for the next property there must be an empty line.
- Status changed to Needs review
about 1 year ago 5:30am 18 October 2023 - ๐ฎ๐ณIndia mrinalini9 New Delhi
Updated patch #6 by addressing #10 and some other phpcs issues (missing type hint), please review it.
Thanks!
- Status changed to RTBC
about 1 year ago 6:10am 18 October 2023 - ๐ฎ๐ณIndia vsheokeen NCR
Took clone from latst version
Ran the PHPCS commands
Applied the Patch
Ran again all commands.Now it looks clean. So moving to RTBC
- Status changed to Needs work
about 1 year ago 7:25am 18 October 2023 - ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
+ '#description' => $this->t( + 'Enter Where On Earth IDentification of location. Find WOEID to use this url http://woeid.rosselliot.co.nz'), + ];
The second line is not correctly indented.
It is probably better to leave the method call on a single line, as it is easier to understand. The fact the first line ends with ( and the last line ends with ] is a bit confusing.public function submitForm(array &$form, FormStateInterface $form_state) { - parent::submitForm($form, $form_state); }
The full method must be deleted.
+ * @param string|null $woeid + * The Where On Earth IDentifier of the location.
IDentifier should be identifier. It is not necessary to say of the location, since a Where on Earth identifier is surely for a location.
+ 'oauth_nonce' => + uniqid(mt_rand(1, 1000)),
The second line is not correctly indented. It is probably better to put the code on a single line.
- CURLOPT_HEADER => false, + CURLOPT_HEADER => + FALSE,
There is not need to put
FALSE
on a new line.+ '#title' => + $this->t('Location list'),
+ '#description' => + $this->t('Select locations to display in block'),
The second line is not correctly indented and it is not necessary to use two lines.
- Status changed to Needs review
about 1 year ago 9:56am 18 October 2023 - ๐ฎ๐ณIndia mrinalini9 New Delhi
Updated patch #11 by addressing #13, please review it.
Thanks!
- Status changed to Needs work
about 1 year ago 11:02am 18 October 2023 - ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
/** * The Drupal configuration factory. * * @var \Drupal\Core\Config\ConfigFactoryInterface */ protected $configFactory; - /** * The Live weather controller. *
That empty line must be kept.
/** - * {@inheritdoc} + * Creates an instance of the LiveWeatherForm plugin. + * + * @param \Symfony\Component\DependencyInjection\ContainerInterface $container + * The service container. + * @param array $configuration + * An associative array of configuration settings. + * @param string $plugin_id + * The plugin ID for the plugin instance. + * @param mixed $plugin_definition + * The plugin definition. + * + * @return static + * A new instance of the LiveWeatherForm plugin. */ public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
Since that is a method defined in an interface, the existing documentation comment is already correct.
/** - * {@inheritdoc} + * Builds the form for configuring the block settings. + * + * @param array $form + * An associative array representing the form structure. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * The current state of the form. + * + * @return array + * The built form structure. */ - public function blockForm($form, FormStateInterface $form_state) {
The existing documentation comment is already correct.
- ๐ฎ๐ณIndia pray_12
Preethy_ray โ made their first commit to this issueโs fork.
- ๐ฎ๐ณIndia Yashaswi18
Applied patch provided in #14, patch applied cleanly, all phpcs issues are fixed. The reviews yet to be addressed.
Ran this command to check :
phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml live_weather/ - ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
The merge request has more recent changes. That needs to be reviewed, not the patch.
- Status changed to Needs review
10 months ago 2:30pm 22 January 2024 - Status changed to Needs work
10 months ago 4:29pm 22 January 2024 - Status changed to Needs review
10 months ago 5:49am 23 January 2024 - Status changed to Needs work
10 months ago 9:54am 23 January 2024 - Status changed to Needs review
9 months ago 7:51am 13 February 2024 - ๐ฎ๐ณIndia zkhan.aamir
Hi,
I have checkout 3379900-phpcs-errors this branch and run the above command.
There are no errors found.Admin@DESKTOP-252TO6V MINGW64 ~/Desktop/projects/drupal/web/modules $ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,js,yml live_weather/ Admin@DESKTOP-252TO6V MINGW64 ~/Desktop/projects/drupal/web/modules $
- Status changed to Needs work
3 months ago 11:42pm 14 August 2024 Hi @everyone,
Applied the latest changes on MR!6, one error was thrown by my terminal. Please see below:
live_weather git:(main) โ curl https://git.drupalcode.org/project/live_weather/-/merge_requests/6.diff | patch -p1 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 18602 0 18602 0 0 46684 0 --:--:-- --:--:-- --:--:-- 48191 patching file README.md patching file src/Controller/LiveWeatherController.php patching file src/Form/LiveWeatherDeleteForm.php patching file src/Form/LiveWeatherForm.php patching file src/Form/LiveWeatherSettingsForm.php patching file src/LiveWeather.php patching file src/LiveWeatherInterface.php patching file src/Plugin/Block/LiveWeatherBlock.php โ live_weather git:(main) โ .. โ contrib git:(main) โ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig live_weather FILE: ...-site/drupal-orgissue/web/modules/contrib/live_weather/src/LiveWeather.php -------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE -------------------------------------------------------------------------------- 190 | ERROR | [x] Doc comment short description must end with a full stop -------------------------------------------------------------------------------- PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY -------------------------------------------------------------------------------- Time: 365ms; Memory: 10MB
Kindly check
Thanks,
Jake- Merge request !8Created a new merge request to get the list of all the PHP_CodeSniffer errors/warnings to fix โ (Open) created by apaderno
- Assigned to apaderno
- ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
- Status changed to Needs review
3 months ago 10:46am 16 August 2024 - Issue was unassigned.
- ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
avpaderno โ changed the visibility of the branch 3379900-gitlab-ci-reports to hidden.