-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
Check the entire code base for compliance with DOC String standard #226
Check the entire code base for compliance with DOC String standard #226
Conversation
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThis pull request introduces a comprehensive docstring compliance validation mechanism for the project. A new GitHub Actions job named Changes
Sequence DiagramsequenceDiagram
participant GHA as GitHub Actions
participant Script as check_docstrings.py
participant Parser as docstring_parser
GHA->>Script: Run docstring validation
Script->>Script: Scan Python files
Script->>Parser: Parse docstrings
Parser-->>Script: Validation results
Script->>GHA: Report compliance status
Assessment against linked issues
Possibly related PRs
Suggested labels
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Our Pull Request Approval ProcessWe have these basic policies to make the approval process smoother for our volunteer team. Testing Your CodePlease make sure your code passes all tests. Our test code coverage system will fail if either of these two conditions occur:
The process helps maintain the overall reliability of the code base and is a prerequisite for getting your PR approved. Assigned reviewers regularly review the PR queue and tend to focus on PRs that are passing. ReviewersWhen your PR has been assigned reviewers contact them to get your code reviewed and approved via:
Reviewing Your CodeYour reviewer(s) will have the following roles:
🎯 Contacting the person who assigned the mentors is not advised unless they make a request. Do not @ the person who did the assignment otherwise. |
@coderabbitai full review |
✅ Actions performedFull review triggered. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (6)
.github/workflows/scripts/check_docstrings.py (2)
27-37
: Consider checking for aReturns
section to fully align with Google style docstrings.
While you currently validate the presence ofRaises
andArgs
sections, Google style guidelines also recommend including aReturns
section where applicable.
21-22
: Handleasync def
definitions if needed.
The current regex only matches regular functions but would skipasync def
definitions if your codebase includes them.requirements.txt (1)
31-33
: Pin or specify the version ofdocstring_parser
.
To maintain consistent CI results and avoid unexpected regressions, consider pinning this dependency to a known compatible version..github/workflows/pull-request.yml (3)
224-224
: Remove trailing spaces.
YAML linters will fail if they detect trailing white spaces on this line.+224
🧰 Tools
🪛 yamllint (1.35.1)
[error] 224-224: trailing spaces
(trailing-spaces)
230-230
: Update action version to adhere to the latest GitHub Actions guidelines.
Static analysis indicates thatactions/checkout@v3
might be out-of-date. Consider usingactions/checkout@v4
.- - name: Checkout code - uses: actions/checkout@v3 + - name: Checkout code + uses: actions/checkout@v4🧰 Tools
🪛 actionlint (1.7.4)
230-230: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
241-241
: Add a newline and remove trailing spaces at the end of the file.
YAML and some CI validators may enforce no trailing spaces and a newline at EOF for compliance.- run: python .github/workflows/scripts/check_docstrings.py + run: python .github/workflows/scripts/check_docstrings.py +🧰 Tools
🪛 yamllint (1.35.1)
[error] 241-241: no new line character at the end of file
(new-line-at-end-of-file)
[error] 241-241: trailing spaces
(trailing-spaces)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.github/workflows/pull-request.yml
(1 hunks).github/workflows/scripts/check_docstrings.py
(1 hunks)requirements.txt
(1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/pull-request.yml
230-230: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
233-233: the runner of "actions/setup-python@v4" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
🪛 yamllint (1.35.1)
.github/workflows/pull-request.yml
[error] 224-224: trailing spaces
(trailing-spaces)
[error] 241-241: no new line character at the end of file
(new-line-at-end-of-file)
[error] 241-241: trailing spaces
(trailing-spaces)
🔇 Additional comments (3)
.github/workflows/scripts/check_docstrings.py (2)
28-31
: Consider edge cases when parsing multiline docstrings that close on the same line.
If the docstring’s triple quotes end on the same line they started, this approach may skip them.
79-90
: Exit code logic looks good.
Exiting withsys.exit(1)
on violation detection ensures that CI will fail appropriately when docstring violations are found..github/workflows/pull-request.yml (1)
225-241
: Job definition looks good.
The newDocstring-Compliance
job neatly integrates docstring checks into the CI pipeline.🧰 Tools
🪛 actionlint (1.7.4)
230-230: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
233-233: the runner of "actions/setup-python@v4" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
🪛 yamllint (1.35.1)
[error] 241-241: no new line character at the end of file
(new-line-at-end-of-file)
[error] 241-241: trailing spaces
(trailing-spaces)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You will have to lint the entire code base to make sure it is compliant with your test.
Then after doing that you'll have to edit one of the files to be non compliant and validate your test works
@palisadoes oh alright so only it didn't run the pull request check? |
Please fix |
@palisadoes I am not finding a linting package used in this code base. |
|
I changed the branch protection rules. It should be OK the next time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment
Ok I will try fix it , it still is not working |
…tchmap-ng into autogenerate-pr-1
@palisadoes I have edited all the files which didnt follow DOC string standard |
sorry there still seems to be few more i will fix in some time |
@palisadoes Please check, If its proper i will remove print statements and commit clean code |
e4b8cba
into
PalisadoesFoundation:develop
What kind of change does this PR introduce?
This change will check the entire code base for comapliance with the DOC string compliance
Issue Number:
Fixes #210
If relevant, did you update the documentation?
No
Does this PR introduce a breaking change?
No
Checklist
CodeRabbit AI Review
Test Coverage
Have you read the contributing guide?
Yes
Summary by CodeRabbit
New Features
Chores
docstring_parser
package to project requirementsThe changes enhance code documentation quality and enforce documentation standards through automated checks.