Problem/Motivation

Getting following warnings.

FILE: /var/www/html/modules/contrib/rsg/src/RandomGenerator.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------
182 | WARNING | Exceptions should not be translated
182 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
------------------------------------------------------------------------------------------------------------------------------------------

Time: 2.04 secs; Memory: 6MB

Steps to reproduce

Run following command

phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml modules/contrib/rsg/

Proposed resolution

Above warnings need to be fixed.

CommentFileSizeAuthor
#8 rsg-after-patch.png23.68 KBrishu_kumar
#2 3335596-2.patch511 bytessamitk

Issue fork rsg-3335596

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:

  • main Comparechanges, plain diff MR !1

Comments

samit.310@gmail.com created an issue. See original summary.

samitk’s picture

Assigned: samitk » Unassigned
Status: Needs work » Needs review
StatusFileSize
new511 bytes

Above warnings are fixed.

charchil khandelwal’s picture

Assigned: Unassigned » charchil khandelwal
charchil khandelwal’s picture

Status: Needs review » Needs work

The patch #2 has been reviewed and applied cleanly, but a few phpcs still remain.

FILE: C:\Users\Admin\Downloads\rsg\rsg.info.yml
----------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 1 LINE
----------------------------------------------------------------------
1 | WARNING | Remove "project" from the info file, it will be added
| | by drupal.org packaging automatically
1 | WARNING | Remove "datestamp" from the info file, it will be
| | added by drupal.org packaging automatically
1 | WARNING | Remove "version" from the info file, it will be added
| | by drupal.org packaging automatically
----------------------------------------------------------------------

Time: 539ms; Memory: 10MB

charchil khandelwal’s picture

Assigned: charchil khandelwal » Unassigned
samitk’s picture

Status: Needs work » Needs review

Hi @Charchil Khandelwal,

I checked rsg.info.yml file, The project, datestamp, version keys are not there. Please check below

name: Random String Generator
type: module
description: Module for generating the random string based on length and type.
core_version_requirement: ^8 || ^9 || ^10
package: String

Looks like you download that module with composer or manually. Please download it with git by following command, than try that patch.

git clone https://git.drupalcode.org/project/rsg.git

rishu_kumar’s picture

Assigned: Unassigned » rishu_kumar

I will review it.

rishu_kumar’s picture

Assigned: rishu_kumar » Unassigned
StatusFileSize
new23.68 KB

When I apply #2 patch.Patch apply cleanly.
I attached screenshot for Reference.
It can be moved to RTBC.

Thanks

Sonal Gyanani’s picture

Assigned: Unassigned » Sonal Gyanani

Sonal Gyanani’s picture

Assigned: Sonal Gyanani » Unassigned
Status: Needs review » Reviewed & tested by the community

Patch #2 applied cleanly, all errors and warnings are fixed.
Moving it to RTBC.
Thanks

praveen3555’s picture

Assigned: Unassigned » praveen3555
Status: Reviewed & tested by the community » Fixed
Issue tags: -, -

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

praveen3555’s picture

Status: Fixed » Closed (fixed)