Add review checklist

This PR adds a small checklist for new PRs that will make it more
visible what parts of the RSPEC were reviewed.
This commit is contained in:
hendrik-buchwald-sonarsource 2023-06-06 17:04:39 +02:00 committed by GitHub
parent d189c21fd7
commit a315e5de4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 2 deletions

8
.github/pull_request_template.md vendored Normal file
View File

@ -0,0 +1,8 @@
## Review
A dedicated reviewer checked the rule description successfully for:
- [ ] logical errors and incorrect information
- [ ] information gaps and missing content
- [ ] text style and tone

View File

@ -177,11 +177,19 @@ NOTE: use a GitHub hot-key `t` in the source view to navigate to an existing rul
=== 2. Ask for a review
Every PR that is creating or modifying a rule should be reviewed.
Exceptions can be made for small PRs that only resolve simple spelling mistakes.
If it is a new rule, or if it requires the analyzer to change its implementation, do not merge the pull request yet.
If the change does not require an implementation, merge the pull request after the review.
Following the submission of every PR, an automatic checklist will be generated.
This checklist is intended for the reviewer and serves as a guide to ensure comprehensive evaluation of the PR.
As the reviewer navigates through the review process, each fulfilled item on the checklist should be marked off.
A PR should not be merged before the checklist is fully completed.
This ensures that all necessary checks have been made, and all requirements have been met before merging, fostering a systematic and thorough review process.
=== 3. Create an implementation ticket
Create an implementation ticket as it is usually done for your plugin (i.e. as a Jira ticket or a Github issue). +

View File

@ -39,6 +39,7 @@ def add_language_to_rule(language: str, rule: str, token: str, user: Optional[st
class RuleCreator:
'''Create a new Rule in a repository following the official Github 'rspec' repository structure.'''
TEMPLATE_PATH: Final[Path] = Path(__file__).parent.parent.joinpath('rspec_template')
PR_TEMPLATE_PATH: Final[Path] = Path(__file__).parent.parent.parent.joinpath('.github/pull_request_template.md')
def __init__(self, rspec_repo: RspecRepo):
self.rspec_repo = rspec_repo
@ -129,7 +130,7 @@ class RuleCreator:
token,
branch_name,
f'Create rule S{rule_number}',
f'You can preview this rule [here](https://sonarsource.github.io/rspec/#/rspec/S{rule_number}/{language}) (updated a few minutes after each push).',
f'You can preview this rule [here](https://sonarsource.github.io/rspec/#/rspec/S{rule_number}/{language}) (updated a few minutes after each push).\n\n{self.PR_TEMPLATE_PATH.read_text()}',
[label],
user
)
@ -142,7 +143,7 @@ class RuleCreator:
token,
branch_name,
f'Create rule S{rule_number}',
f'You can preview this rule [here](https://sonarsource.github.io/rspec/#/rspec/S{rule_number}/{first_lang}) (updated a few minutes after each push).',
f'You can preview this rule [here](https://sonarsource.github.io/rspec/#/rspec/S{rule_number}/{first_lang}) (updated a few minutes after each push).\n\n{self.PR_TEMPLATE_PATH.read_text()}',
labels,
user
)