Skip to content

Consistent python formatting #339

@mikebentley15

Description

@mikebentley15

Feature Request

Description:

The python formatting currently is done by hand by the original author (myself). This is not particularly sustainable.

It may be worthwhile to look into third-party code formatting tools. The same may be true with C++, but this feature request specifically refers to the python code which is now the majority of the code (I think).

Suggested change:

This is brought on because I found a tool called python-black which easily and reproducibly formats python code. I think it's worth looking into to see if we would like to adopt this tool officially for formatting our python code in FLiT.

It may be worthwhile making it easy to automatically run this formatter as git hooks, like commits or pushes. I'd probably prefer simply enforcing the use of this formatter (if we like it) by checking in a simple unit test that running the formatter changes nothing.

Alternative approaches:

There may be other code formatters that we like, but it seems black is popular and used by big groups like Python Pandas. But if we don't like the formatting scheme, we can look into other choices.

Metadata

Metadata

Assignees

No one assigned

    Labels

    devopsContinuous Integration and development environmentdocumentationInvolves touching documentation

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions