BLD: Run flake8 check on Cython files in pre-commit
- [x] closes #30843
- [ ] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

@datapythonista Fixed the configuration, CI now passes. > Looks good, I'd probably have the flake config files somewhere else, since we've already got too much in our root, but other than that looks good.

I think a `flake8` directory would make sense.  Would also help to simplify filenames. `flake8` or `.flake8`? `flake8` (no dot) should be fine I think. Keep things simple. @jbrockmendel can you try this out I'm missing something from the workflow.  I've checked out this branch, added a flake-violation to groupby.pyx, but commiting it doesnt seem to cause any problem.  What am I missing?

Can W293 for trailing whitespace be added?

Not a deal-breaker, but I like the more verbose way we list codes in statsmodels: https://github.com/statsmodels/statsmodels/blob/master/setup.cfg#L73 > I'm missing something from the workflow. I've checked out this branch, added a flake-violation to groupby.pyx, but commiting it doesnt seem to cause any problem. What am I missing?
> 
> Can W293 for trailing whitespace be added?
> 
> Not a deal-breaker, but I like the more verbose way we list codes in statsmodels: https://github.com/statsmodels/statsmodels/blob/master/setup.cfg#L73

The obvious one:
Did run `pre-commit install` once?

Otherwise: Can you tell me what you did change? Then I can try to reproduce locally. rebased and CI passed. >  Did run pre-commit install once?

Looks like `brew install pre-commit` followed by `pre-commit install` did the trick, thanks.

LGTM

W293 can be follow-up. Thanks @xhochy 