You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a custom Clippy lint that checks for the specific TODO format TODO(username): message, URL where the URL can be a GitHub or Jira issue.
Purpose
Ensure that TODO comments in the codebase adhere to a standard format:
TODO(username): message, URL. The URL should link to a GitHub or Jira issue.
Lint Description
Warns when encountering a TODO comment that does not match the following format:
TODO(username): message, URL
Where:
username is a placeholder for the developer's username. message is a short description of the TODO. URL is a link to a GitHub or Jira issue.
Criteria
The lint should consider a comment as a valid TODO format if:
The comment starts with the string TODO(.
The comment contains a ): following the TODO(. The enclosed value should be considered the username.
After the ):, there should be a brief message.
After the message, there should be a comma , followed by a space.
The comment ends with a URL. The URL should start with https:// and should link to either a GitHub issue (github.com/owner/repo/issues/number) or a Jira issue (typically company-name.atlassian.net/browse/ISSUE-ID).
Non-Criteria
The lint should not enforce any specific length or content constraints for the message part, as long as it's followed by a,
and a space.
The lint should not enforce the validity of the URL, only its format.
Examples
Valid TODOs
// TODO(john_doe): Implement the authentication module, https://github.com/myrepo/myproject/issues/123
// TODO(jane_doe): Refactor the function for clarity, https://company-name.atlassian.net/browse/BUG-456
Invalid TODOs
// TODO: Implement this!
// TODO(john_doe) Fix this issue.
// TODO(jane_doe): This needs to be fixed, myproject/issues/123
Output Message
Found TODO comment that doesn't adhere to the standard format:
TODO(username): message, URL.` Please include the developer's username and a link to a GitHub or Jira issue.
Implementation Notes
Regular expressions could be used to match the specific format.
The lint should look for comments starting with TODO( to minimize unnecessary parsing.
Additional Considerations:
Consider expanding the lint to support other popular issue trackers in the future.
Consider implementing a method to verify the URL is validity (but be cautious about accidentally making web requests).
The text was updated successfully, but these errors were encountered:
I would say that the URL should always be a github issue if the repo is public. And if there is a jira issue it can be linked to from the github issue.
Create a custom Clippy lint that checks for the specific TODO format
TODO(username): message, URL
where the URL can be a GitHub or Jira issue.Purpose
Ensure that TODO comments in the codebase adhere to a standard format:
TODO(username): message, URL. The URL should link to a GitHub or Jira issue.
Lint Description
Warns when encountering a TODO comment that does not match the following format:
Where:
username is a placeholder for the developer's username.
message is a short description of the TODO.
URL is a link to a GitHub or Jira issue.
Criteria
The lint should consider a comment as a valid TODO format if:
TODO(
.TODO(
. The enclosed value should be considered the username.):
, there should be a brief message.,
followed by a space.https://
and should link to either a GitHub issue (github.com/owner/repo/issues/number
) or a Jira issue (typically company-name.atlassian.net/browse/ISSUE-ID
).Non-Criteria
and a space.
Examples
Valid TODOs
Invalid TODOs
Output Message
Found TODO comment that doesn't adhere to the standard format:
Implementation Notes
Additional Considerations:
The text was updated successfully, but these errors were encountered: