Skip to content

STYLE move spacing conventions in cython casting to pre-commit #42121

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

Closed
MarcoGorelli opened this issue Jun 19, 2021 · 2 comments · Fixed by #42186
Closed

STYLE move spacing conventions in cython casting to pre-commit #42121

MarcoGorelli opened this issue Jun 19, 2021 · 2 comments · Fixed by #42186
Assignees
Labels
Code Style Code style, linting, code_checks good first issue

Comments

@MarcoGorelli
Copy link
Member

here's the check which needs moving, it's in ci/code_checks.sh

### LINTING ###
if [[ -z "$CHECK" || "$CHECK" == "lint" ]]; then

    # Check that cython casting is of the form `<type>obj` as opposed to `<type> obj`;
    # it doesn't make a difference, but we want to be internally consistent.
    # Note: this grep pattern is (intended to be) equivalent to the python
    # regex r'(?<![ ->])> '
    MSG='Linting .pyx code for spacing conventions in casting' ; echo $MSG
    invgrep -r -E --include '*.pyx' --include '*.pxi.in' '[a-zA-Z0-9*]> ' pandas/_libs
    RET=$(($RET + $?)) ; echo $MSG "DONE"

    # readability/casting: Warnings about C casting instead of C++ casting
    # runtime/int: Warnings about using C number types instead of C++ ones
    # build/include_subdir: Warnings about prefacing included header files with directory

fi

It could be a pygrep check

@MarcoGorelli MarcoGorelli added Code Style Code style, linting, code_checks good first issue labels Jun 19, 2021
@MarcoGorelli
Copy link
Member Author

MarcoGorelli commented Jun 19, 2021

This could be added to the unwanted-patterns hook

@01-vyom
Copy link
Contributor

01-vyom commented Jun 21, 2021

take

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 good first issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants