Rubocop: Extend Graphql/Descriptions cop to ban descriptions with "this" (lowercase) in them
About
There are a number of violations of our GraphQL description styleguide's recommendation to:
Use
"{x} of the {y}"
where possible. Example: ``Title of the issue'`.
Instead, we often see people using the word this
instead of the
.
We would like to extend the existing Graphql/Descriptions
cop to ban the use of this
in descriptions. Note an uppercased This
appearing mid-description would be acceptable as this would be the start of a new sentence.
Note: There are some legitimate uses if this
which are not contrary to our styleguide, however, on weight, these are few, and we should reword those to avoid needing to use the word this
so that we can enable this cop to cover the vast number of uses that are violating the styleguide.
Process
Update the existing Graphql/Descriptions
cop and the corresponding spec with the functionality.
Follow the resolving robocop exceptions process to add existing offenses to .rubocop_todo.yml
in the MR that introduces the cop.
Successive merge requests would fix the violations and remove them from .rubocop_todo.yml
. You might have to work with a technical writer to help reword legitimate uses of this
to not use it.
Tip: To see how many potential offenses we would need to correct ahead of time, you can dump the schema and then search for this
(case-sensitive).