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

CI: Improve API of --ignore_errors in validate_docstrings.py #57908

Merged

Conversation

datapythonista
Copy link
Member

Follow up of #57879, to use --ignore_errors PR02,SA01 instead of --ignore_errors * PR02,SA01.

I also make the script ignore the specified errors when running for a single document (i.e. validate_docstrings.py pandas.Series -i SA01 was reporting the SA01 error before this PR, and it won't with the changes here).

CC: @mroeschke

@datapythonista datapythonista added Docs CI Continuous Integration labels Mar 19, 2024
Copy link
Contributor

@dontgoto dontgoto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably overly safe, but one could verify that only one CLI parameter is specifying globally ignored errors, otherwise one set would overwrite the other

@datapythonista
Copy link
Member Author

It's probably overly safe, but one could verify that only one CLI parameter is specifying globally ignored errors, otherwise one set would overwrite the other

It shouldn't overwrite it, I'm not sure if I explicitly tested it, but the way I implemented was to allow to do validate_docstrings.py -i PR01 -i SA01 and ignore each of them:

ignore_errors[None].update(set(error_codes.split(",")))

What I don't check is if there are duplicates, but that's not likely going to be useful since we just have one error being fully ignored, and I don't think we'll be adding any or many more errors to the script.

What I'm not sure is what happens if an object (e.g. pandas.Series.head) contains a typo, maybe it's ignored silently.

@mroeschke mroeschke added this to the 3.0 milestone Mar 19, 2024
@mroeschke mroeschke merged commit aa3e949 into pandas-dev:main Mar 19, 2024
46 checks passed
@mroeschke
Copy link
Member

Thanks @datapythonista

@jordan-d-murphy
Copy link
Contributor

Thanks for all the work on this @datapythonista! code_checks.sh is looking awesome with thse new improvements. Just wanted to check and make sure this was the last change you had pending. If this is the final update, I can go ahead and open new issues to address these.

@datapythonista
Copy link
Member Author

Yes, no more changes to the ignore functions in code_checks.sh. You should also have the triage permissions now.

@jordan-d-murphy
Copy link
Contributor

Opened DOC: Enforce Numpy Docstring Validation (Parent Issue) #58063 as a parent issue for fixing docstrings based on the refactoring in code_checks.sh

Feel free to swing by and help out! 🙂

pmhatre1 pushed a commit to pmhatre1/pandas-pmhatre1 that referenced this pull request May 7, 2024
…dev#57908)

* CI: Improve API of --ignore_errors in validate_docstrings.py

* Updating tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Continuous Integration Docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants