Skip to content

LINT: pandas/scripts #18949

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
jreback opened this issue Dec 26, 2017 · 18 comments · Fixed by #19344
Closed

LINT: pandas/scripts #18949

jreback opened this issue Dec 26, 2017 · 18 comments · Fixed by #19344
Labels
Code Style Code style, linting, code_checks good first issue
Milestone

Comments

@jreback
Copy link
Contributor

jreback commented Dec 26, 2017

need to lint these & add a rule in ci/lint.sh to check.

@jreback jreback added good first issue Code Style Code style, linting, code_checks labels Dec 26, 2017
@jreback jreback added this to the Next Major Release milestone Dec 26, 2017
@gfyoung
Copy link
Member

gfyoung commented Dec 27, 2017

Yeah, that directory could certainly benefit from a lot of clean-up.

@bhavybarca
Copy link

I would like to work on this as my first issue

@gfyoung
Copy link
Member

gfyoung commented Jan 5, 2018

@bhavybarca : Go for it!

@bhavybarca
Copy link

what all do i need to do, i am a beginner

@jreback
Copy link
Contributor Author

jreback commented Jan 6, 2018

you need to add a add pandas/scripts/ to the ci/lint.sh script (make it a separate step)
then run this export LINT=1; ci/lint.sh and see what turns up, which needs fixing. you can use autopep8 to fix most

@bhavybarca
Copy link

so first i need to make ci/lint.sh script and then copy the files to it ?

@jreback
Copy link
Contributor Author

jreback commented Jan 6, 2018

it’s aleady there just edit

@bhavybarca
Copy link

can you please simplify all this a bit am i just starting

@TomAugspurger
Copy link
Contributor

This file: https://github.com/pandas-dev/pandas/blob/master/ci/lint.sh

You'll add another flake8 line like the others, but for scripts/ directory.

@bhavybarca are you on Windows or Mac or Linux? You'll set the LINT environment variable and then run ci/lint.sh, which will print out a list of errors that need to be fixed.

@TomAugspurger
Copy link
Contributor

It'll be roughly like

$ flake8 scripts/
scripts/api_rst_coverage.py:24:1: E302 expected 2 blank lines, found 1
scripts/api_rst_coverage.py:64:80: E501 line too long (90 > 79 characters)
scripts/api_rst_coverage.py:70:80: E501 line too long (93 > 79 characters)
scripts/api_rst_coverage.py:78:80: E501 line too long (88 > 79 characters)
...

@gfyoung
Copy link
Member

gfyoung commented Jan 6, 2018

@TomAugspurger : I prefer to use flake8 scripts/. No need to lint the entire repository for this issue.

@TomAugspurger
Copy link
Contributor

yeah, agreed.

@datapythonista
Copy link
Member

I think it makes sense to include as part of this ticket, couple of other things related to the scripts:

  • Fix PEP-8 issues, and add check to lint (as originally requested on the ticket)
  • Add documentation to scripts that don't have it (like find_undoc_args.py)
  • Make all the scripts executable (chmod a+x and #! header)
  • Create a section in contributing.rst with the available script and what they are used for
  • Make the scripts work regardless of the current directory (announce.py needs to be called from the pandas home, api_rst_coverage.py from the scripts directory...)
  • Follow the same convention in script names (rename merge-pr.py to merge_pr.py)

What do you think?

@bhavybarca
Copy link

@TomAugspurger i m on linux 16.04, all this makes a lot of sense now thanks ,just last thing how do i setup lint environment to run lint.sh

@gfyoung
Copy link
Member

gfyoung commented Jan 7, 2018

@datapythonista : All of these are excellent ideas! I think linting is a pretty big step as it is though, so might be worthwhile to just open another issue.

@datapythonista
Copy link
Member

@bhavybarca I'll take this, if that's all right

@bhavybarca
Copy link

@datapythonista yeah sure!!

@gfyoung
Copy link
Member

gfyoung commented Jan 22, 2018

As a follow-up, we should document all of these functions (@datapythonista : no need to this in your open PR, but wanted to add that just so that we don't forget 😄 )

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.

5 participants