GenieFramework / StippleDemos

Demo apps for Stipple
49 stars 29 forks source link

proposal: use JuliaFormatter.jl for formatting codes in BasicExamples #19

Closed sudame closed 2 years ago

sudame commented 2 years ago

This repository contains a mixture of Julia codes written in various code styles. This not only makes collaboration difficult, but also hinders the understanding of beginners, the main users of this repository.

Thankfully, there are some good formatter for Julia. The most famous and common one is JuliaFormatter.jl; this formatter is used in de-facto standard vscode extension.

what I did in this PR

I did the following in the BasicExamples directory.

  1. install JuliaFormatter.jl
  2. write format rules in .JuliaFormatter.toml (see the formatter's README)
  3. run using JuliaFormatter; format(".") in the Julia REPL
  4. run include("XXX.jl") in the Julia REPL, and confirm that the formatting did not change output

Note that, this repository has some broken examples, so in step 4 I could only check for the working examples.

AbhimanyuAryan commented 2 years ago

@sudame thanks for contributing will review it

essenciary commented 2 years ago

@sudame Looks really good, thank you for this! Any thoughts on integrating the JuliaFormatter.jl package/step in CI (or somehow into the workflow in automated way)?

sudame commented 2 years ago

@essenciary Thank you for your review and merge 🚀 I'd like to set up CI (I'm thinking of using GitHub Actions) to format with JuliaFormatter.jl, but I have no time in this week. Should I post a issue?

essenciary commented 2 years ago

@sudame yes please, that'd be great so we don't forget about it.