Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create I18n_Usage_Check #18

Closed
Tracked by #3
mehulkaklotar opened this issue Nov 21, 2022 · 5 comments · Fixed by #62
Closed
Tracked by #3

Create I18n_Usage_Check #18

mehulkaklotar opened this issue Nov 21, 2022 · 5 comments · Fixed by #62
Assignees
Labels
15 Estimate of 15 points Checks Audit/test of the particular part of the plugin Milestone 1 [Type] Enhancement A suggestion for improvement of an existing feature
Milestone

Comments

@mehulkaklotar
Copy link
Member

mehulkaklotar commented Nov 21, 2022

Description

Checks that WordPress internationalization functions are used properly, including using a valid textdomain that matches the plugin’s textdomain in the main file comment header. It will also include checks for each of the localization functions for typos and ensure the correct parameters are passed. This will use the existing WordPress.WP.I18n sniff in the WordPress Coding Standards.

Acceptance Criteria

  • Class I18n_Usage_Check should be created and exists at includes/Checker/Checks
  • Class I18n_Usage_Check should extend the Abstract_PHP_CodeSniffer_Check abstract class
  • Class should implement the public get_args() and return an associative array of the required PHPCS arguments
    • 'sniffs' => 'WordPress.WP.I18n'
    • 'standard' => 'WordPress'

Tests Coverage

  • get_args() method returns the expected array of PHPCS arguments for the check
  • run() method adds a correct message to the $check_result when checking an invalid file
  • run() method does not add any message to the $check_result when checking a valid file
@mehulkaklotar mehulkaklotar added [Type] Enhancement A suggestion for improvement of an existing feature Checks Audit/test of the particular part of the plugin Infrastructure Issues for the overall plugin infrastructure and removed Infrastructure Issues for the overall plugin infrastructure labels Nov 23, 2022
@mehulkaklotar mehulkaklotar self-assigned this Dec 9, 2022
@mehulkaklotar mehulkaklotar added the 15 Estimate of 15 points label Dec 9, 2022
@mehulkaklotar mehulkaklotar removed their assignment Dec 9, 2022
@eclarke1 eclarke1 added this to the Sprint 3 milestone Jan 12, 2023
@felixarntz
Copy link
Member

@jjgrainger The ACs here were added a while ago and are outdated. They need to be updated to reflect the way the Abstract_PHPCodeSniffer_Check works now.

@jjgrainger
Copy link
Contributor

Thanks @felixarntz

I've updated the AC's to reflect the changes made to the Abstract_PHPCodeSniffer_Check.

@felixarntz
Copy link
Member

@jjgrainger ACs LGTM!

@vishalkakadiya
Copy link

@jjgrainger Added a standard argument in the task description as we need to test the translation logic against WP coding standards. Let me know if you have any other suggestions, thank you!

CC @felixarntz

@vishalkakadiya
Copy link

@jjgrainger I have addressed your feedback and left one question for you. Thank you!

@eclarke1 eclarke1 modified the milestones: Sprint 3, Sprint 4 Jan 31, 2023
bordoni added a commit that referenced this issue Sep 13, 2023
bordoni added a commit that referenced this issue Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
15 Estimate of 15 points Checks Audit/test of the particular part of the plugin Milestone 1 [Type] Enhancement A suggestion for improvement of an existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants