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

Code style standardization #93

Open
dunossauro opened this issue Feb 18, 2020 · 2 comments
Open

Code style standardization #93

dunossauro opened this issue Feb 18, 2020 · 2 comments
Assignees
Labels

Comments

@dunossauro
Copy link

Create standard to define new PRs and commit.

We have many case like that:

rectangle = {
'stroke_color': stroke_color,
'stroke_opacity': stroke_opacity,
'stroke_weight': stroke_weight,
'fill_color': fill_color,
'fill_opacity': fill_opacity,
'bounds': {'north': north,
'west': west,
'south': south,
'east': east,
}
}

What the form is more correctly or preferable for this project?

I think the best way is to use the Black and respect PEP-8 using black -l 80

Maybe add -s flag to not normalize strings.

Another case is related to docstring standards:

"""Builds the Map properties"""

In some docstrings we have parameters explanations in others not. In another cases we has things that can be replaced by type annotations

def build_polylines(self, polylines):
""" Process data to construct polylines
This method is built from the assumption that the polylines parameter
is a list of:
list of lists or tuples : a list of path points, each one
indicating the point coordinates --
[lat,lng], [lat, lng], (lat, lng), ...

We can test it in a CI using tox, or not, is only a sugestion

@vit0r
Copy link

vit0r commented Feb 21, 2020

For the dev/env vscode, we can create some settings.json rules like:

autodocstring ext

${HOME}/.config/Code\ -\ Insiders/User/settings.json
{
    "autoDocstring.docstringFormat": "google",
    "autoDocstring.includeName": true,
    "autoDocstring.includeExtendedSummary": true,
    "autoDocstring.startOnNewLine": false,
    "python.linting.flake8Enabled": true,
    "python.linting.pydocstyleEnabled": true,
    "python.linting.pylintEnabled": false,
    "python.linting.pydocstyleArgs": [
        "--convention=google",
        "--ignore=D4"
    ]
}

@Riverfount
Copy link
Member

Riverfount commented Feb 22, 2020

@dunossauro I think that the use o Blak to create a standard for the new commits a great idea. Can you do it and send us a PR?

You can work from this brach. I say it because I think to use a Feature Branch to control the flow of the work.

@dunossauro after standardizes the code with the Black, can you change the README with this code:
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

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

No branches or pull requests

3 participants