Skip to content

Conversation

@jbrockmendel
Copy link
Member

Casting in cython is done with the syntax <type>obj or <type> obj. ATM the code uses both of these. This PR standardizes on the first usage, with a lint check.

@datapythonista I'm not sure whether the grep check here belongs in the patterns section or in the non-python section. LMK if you have a preference.

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

nice

prob should put all of these rules into a flake-cython package :)

@jbrockmendel
Copy link
Member Author

prob should put all of these rules into a flake-cython package :)

If we can find someone else to maintain it, that'd be fantastic.

@codecov
Copy link

codecov bot commented Nov 3, 2018

Codecov Report

Merging #23474 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #23474   +/-   ##
=======================================
  Coverage   92.23%   92.23%           
=======================================
  Files         161      161           
  Lines       51197    51197           
=======================================
  Hits        47220    47220           
  Misses       3977     3977
Flag Coverage Δ
#multiple 90.61% <ø> (ø) ⬆️
#single 42.27% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d78bd7a...8d5e69c. Read the comment docs.

@jbrockmendel
Copy link
Member Author

Not for this PR, but a couple of other patterns that would be relatively easy to lint for:

cimport numpy as np --> should be cnp (not a widely-used convention, but it should be)
* imports
number of lines after function/class

For these purposes (and for this PR) we just assume away comments and docstrings.

@datapythonista datapythonista merged commit 8586644 into pandas-dev:master Nov 4, 2018
@datapythonista
Copy link
Member

Thanks @jbrockmendel, nice addition.

There are reasons for having it with both the linting and the patters, happy with any.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants