Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • W waLBerla
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 40
    • Issues 40
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 15
    • Merge requests 15
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • waLBerla
  • waLBerla
  • Merge requests
  • !306

Unify python code style

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Markus Holzer requested to merge Add_python_formating into master Jul 03, 2020
  • Overview 9
  • Commits 2
  • Pipelines 2
  • Changes 1

There are many python files in the waLberla framework, and the number is consistently growing due to the increasing usage of code generation. Thus, there should be a PEP8 conform style guide to ensure a consistent formatting among these files. A good overview of different python linter tools can be found here.

For the style guide in waLBerla I suggest flake8 since it is a wrapper around PyFlakes, pycodestyle, and Ned Batchelder’s McCabe script. flake8 can be installed via pip. From the waLBerla folder, the tool can be used by calling flake8 apps for example, which states all complaints of all python files in the apps folder. The same can be done for single files or for the whole waLBerla folder.

In the .flake8 file one can then specify the formating.

If we decide to use it as a coding style guideline I would suggest to also enforce the style guide via CI. The same is done in the pystencils package with a simple flake8 pystencils call.

Edited Jul 14, 2020 by Markus Holzer
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: Add_python_formating