Skip to content

STYLE: moving spacing conventions in cython casting to pre-commit #42186

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

Merged
merged 11 commits into from
Aug 10, 2021

Conversation

01-vyom
Copy link
Contributor

@01-vyom 01-vyom commented Jun 22, 2021

@simonjayhawkins simonjayhawkins added the Code Style Code style, linting, code_checks label Jun 25, 2021
@github-actions
Copy link
Contributor

This pull request is stale because it has been open for thirty days with no activity. Please update or respond to this comment if you're still interested in working on this.

@github-actions github-actions bot added the Stale label Jul 26, 2021
@01-vyom
Copy link
Contributor Author

01-vyom commented Jul 26, 2021

This pull request is stale because it has been open for thirty days with no activity. Please update or respond to this comment if you're still interested in working on this.

Working

@MarcoGorelli
Copy link
Member

are you sure? looks like there's still lot's of failures https://github.com/pandas-dev/pandas/pull/42186/checks?check_run_id=3164816180

@01-vyom
Copy link
Contributor Author

01-vyom commented Aug 2, 2021

Sorry for the late reply, I think it's because the check is working on .rst files as well according to the include statement in the .yaml file:

entry: |
(?x)
# outdated annotation syntax, missing error codes
\#\ type:\ (?!ignore)
|\#\ type:\s?ignore(?!\[)
# Incorrect code-block / IPython directives
|\.\.\ code-block\ ::
|\.\.\ ipython\ ::
# Cython casting is of the form `<type>obj` as opposed to `<type> obj`
|[a-zA-Z0-9*]>\s
types_or: [python, cython, rst]

What should we do? separate this check with another id for only cython files?

@MarcoGorelli
Copy link
Member

Ah yes, you're right. Then yes, just make another hook and only run it on .pyx and .pxi.in files in pandas/_libs

Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

sorry, forgot this last time, we should also remove 'lint' from this file (there's a few places where it crops up)

# $ ./ci/code_checks.sh lint # run linting only

@01-vyom
Copy link
Contributor Author

01-vyom commented Aug 9, 2021

sorry, forgot this last time, we should also remove 'lint' from this file (there's a few places where it crops up)

# $ ./ci/code_checks.sh lint # run linting only

Made the changes, should be good to go

@MarcoGorelli
Copy link
Member

oops, CI checks are failing, there's still

- name: Linting
run: ci/code_checks.sh lint
if: always()

(after that, should be good to go!)

@01-vyom
Copy link
Contributor Author

01-vyom commented Aug 9, 2021

Need to make changes in docs as well.

@01-vyom
Copy link
Contributor Author

01-vyom commented Aug 9, 2021

There are also docs for pattern matching, but it has been moved so should I change it as well?

Doc1

Doc2:

# This script is intended for both the CI and to check locally that code standards are
# respected. We are currently linting (PEP-8 and similar), looking for patterns of
# common mistakes (sphinx directives with missing blank lines, old style classes,
# unwanted imports...), we run doctests here (currently some files only), and we
# validate formatting error in docstrings.

@MarcoGorelli
Copy link
Member

Thanks for spotting that - yeah, sure!

Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

@MarcoGorelli MarcoGorelli added this to the 1.4 milestone Aug 10, 2021
@MarcoGorelli MarcoGorelli merged commit 449c56a into pandas-dev:master Aug 10, 2021
@01-vyom 01-vyom deleted the pandas-42121 branch August 10, 2021 13:40
feefladder pushed a commit to feefladder/pandas that referenced this pull request Sep 7, 2021
…ndas-dev#42186)

* STYLE: moving spacing conventions in cython casting to pre-commit

* BUG: Fix pre-commit hook for cython casting check

* ENH: Add new hook for cython casting

* ENH: Changed hook for cython casting

* Update .pre-commit-config.yaml

* Update code_checks.sh

* ENH: Removed lint comments from code checks

* DOC: Changed documentation for code check

* mention imports and typing in doc

Co-authored-by: Marco Edward Gorelli <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Style Code style, linting, code_checks Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

STYLE move spacing conventions in cython casting to pre-commit
3 participants