Skip to content

Automated code formatting #48

@maximilian-gelbrecht

Description

@maximilian-gelbrecht

After some initial discussion with @bgroenks96 we'll start using code formatter for the repo, most likely Runic. I'll make an initial draft PR probably still this week.

What does this mean?

What's a code formatter: A code formatter automatically formats code in accordance with a standard style guideline. It's usually a command line tool, but even this can be automated (more below). With runic for example, you'd apply it to the repo or a file just by executing runic --inplace path/to/your/file-or-folder

To the existing repo:

  • All code will be once formatted in a draft PR
  • A workflow will be added that checks new PRs if they are matching the style, and if not recommends the contributor to format the code (the formatting itself is not automated in this case)
  • A small section about code format in the docs
  • (We could add another workflow with automated suggested changes based on the style, but I am not sure we really want this)

For developers:

  • You can add Runic to VSCode as a plugin so that either you format on pressing a button or always when saving a file
  • You can add Runic as a git hook so that everytime you commit a file to Terrarium it gets formatted automatically

Both of these things have to be done on the client side, and the readme on https://github.com/fredrikekre/Runic.jl/ provides enough info for that.

Any questions, concerns?

Metadata

Metadata

Assignees

No one assigned

    Labels

    structureIssues related to model code structure or programming patterns

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions