Skip to content
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

DOC: Single Document For Code Guidelines #33851

Open
Stockfoot opened this issue Apr 28, 2020 · 8 comments
Open

DOC: Single Document For Code Guidelines #33851

Stockfoot opened this issue Apr 28, 2020 · 8 comments

Comments

@Stockfoot
Copy link

@Stockfoot Stockfoot commented Apr 28, 2020

Location of the documentation

https://pandas.pydata.org/docs/development/code_style.html
https://pandas.pydata.org/pandas-docs/stable/development/contributing.html#code-standards

Documentation problem

Most of the documentation for the coding style guidelines is limited and in multiple locations. Much of the coding style is in a script.

Suggested fix for documentation

I propose to create a single document that contains all the coding guidelines.
This will allow new contributors to easily see all the required syntax and style for the project.
This also allows newer users to not have to guess against a script or have to keep submitting code over and over to find mistakes.

@simonjayhawkins
Copy link
Member

@simonjayhawkins simonjayhawkins commented Apr 29, 2020

I propose to create a single document that contains all the coding guidelines.

perhaps the google style could be a good template or basis for outline http://google.github.io/styleguide/pyguide.html

personally i prefer a well structured reference style document to a informal prose on the subject.

I think that the reason we have the two documents is that the contributing guidelines contains the descriptive introduction for first time contributors and the code style document contains more details. This second document was only recently introduced and adding the content and some migration of content from the contributing guidlines is WIP.

contributions and PRs welcome.

@Stockfoot
Copy link
Author

@Stockfoot Stockfoot commented Apr 29, 2020

I agree that the google style is a good template. I am currently in an Open Source course and would like to contribute to this.

I am a first time contributor and have never really done this so I have a question that I hope you can answer.

Is it useful/okay practice if I get the outline of the document and the information that already exists about the code style into the document or do I need to try and have a complete document for a pull request?

@simonjayhawkins
Copy link
Member

@simonjayhawkins simonjayhawkins commented Apr 29, 2020

Is it useful/okay practice if I get the outline of the document and the information that already exists about the code style into the document or do I need to try and have a complete document for a pull request?

smaller more atomic PRs are easier to review and will likely get approved/merged quicker.

Ok to start small, any incremental improvements welcome., but probably better to not have a document with empty sections. so could use the google doc for inspiration but not actually have a document with an outline and missing content.

@Stockfoot
Copy link
Author

@Stockfoot Stockfoot commented May 3, 2020

@simonjayhawkins I have begun writing the document in markdown and saw in the documentation section that the project uses Sphinx. Should I switch over to Sphinx before proceeding further or is markdown okay?

@moaraccounts
Copy link
Contributor

@moaraccounts moaraccounts commented May 6, 2020

@Stockfoot I'm new to GitHub, learning first by contributing to documentation. Do you need/want any help?

@Stockfoot
Copy link
Author

@Stockfoot Stockfoot commented May 7, 2020

@moaraccounts sure that would be good. Like I said I have a markdown file going but I'm not sure if I need to switch to Sphinx.
I have pulled the coding guidelines from various places that was already presented. I think the next step is I need to pull unique requirements from the style script but I am not sure how to do that.

@moaraccounts
Copy link
Contributor

@moaraccounts moaraccounts commented May 14, 2020

@Stockfoot I've been looking at the script, trying to understand the requirements. What if you created the documentation in a similar manner to how the code_checks script is constructed? Like, have one section on Linting and pull in the different messages from the other scripts as subsections? Is that what you mean by pulling the requirements from the style script?
For example:
Linting
Check for use of not concatenated strings (This is from code_checks.sh)
Test Case for bare pytest raises (This whole example would be from validate_unwanted_patterns.py, lines 57-114)

@Stockfoot
Copy link
Author

@Stockfoot Stockfoot commented May 20, 2020

@moaraccounts
Yeah that is what I am getting at. Basically a style guide that would allow a first time user to read it and understand the formatting and requirements for how they should code, The script would act as a backup instead of a newer user having to submit over and over to see where they are formatting things wrong.
pandas Coding Style Guide example.pdf
Here is the markdown file I have going, I am trying to format it kind of like the python style guide

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.