[Csnd] Question to devs about code formatting
Date | 2022-08-31 16:34 |
From | Aaron Krister Johnson |
Subject | [Csnd] Question to devs about code formatting |
In pursuing the codebase at times to get a handle on inner details of certain opcodes, I'm noticing some things that could use cleanup in the source code, mainly consistent and pretty formatting, and also some of the location of things is often confusing. |
Date | 2022-08-31 18:02 |
From | Victor Lazzarini |
Subject | Re: [Csnd] [EXTERNAL] [Csnd] Question to devs about code formatting |
I think John takes care of formatting, so it is with him.
But it's important to say that we take a very traditional line in terms of formatting and do not use some of the latter styles.
As far as I am concerned, I let emacs take care of indentations etc and that's about it, but I think John runs scripts regularly to format code.
Prof. Victor Lazzarini
Maynooth University
Ireland
On 31 Aug 2022, at 16:35, Aaron Krister Johnson <akjmicro@gmail.com> wrote:
|
Date | 2022-08-31 20:26 |
From | Aaron Krister Johnson |
Subject | Re: [Csnd] [EXTERNAL] [Csnd] Question to devs about code formatting |
Well, whatever happens, I have to say, some of it ends up unreadable....and inconsistent within the file. That file, for instance, cannot decide whether it want to be columnar in layout, or not. Sometimes, commas have spaces following them, sometimes not, etc. etc. It makes for a jarring read.https://github.com/csound/csound/blob/master/Engine/entry1.c On Wed, Aug 31, 2022 at 10:02 AM Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
|
Date | 2022-08-31 23:11 |
From | Rory Walsh |
Subject | Re: [Csnd] [EXTERNAL] [Csnd] Question to devs about code formatting |
I too struggling with reading some of her source, but it's mostly because I'm involved in other projects that use more modern formatting. I had once a script that would reformat the entire code base. But nowadays I'm just getting used to it. Such a script would be easy to reproduce. On Wed 31 Aug 2022, 8:27 p.m. Aaron Krister Johnson, <akjmicro@gmail.com> wrote:
|
Date | 2022-08-31 23:13 |
From | Rory Walsh |
Subject | Re: [Csnd] [EXTERNAL] [Csnd] Question to devs about code formatting |
My phone added some interesting mistakes there! 🤣 On Wed 31 Aug 2022, 11:11 p.m. Rory Walsh, <rorywalsh@ear.ie> wrote:
|
Date | 2022-08-31 23:40 |
From | Stephen Kyne |
Subject | Re: [Csnd] [EXTERNAL] [Csnd] Question to devs about code formatting |
Clang format can be used for this: https://clang.llvm.org/docs/ClangFormat.html. It can make merging branches a bit of a pain though. I use Prettier for typescript and something
like that is nice to use that enforces a style across all dev's machines.
Stephen
From: A discussion list for users of Csound <CSOUND@LISTSERV.HEANET.IE> on behalf of Rory Walsh <rorywalsh@EAR.IE>
Sent: Wednesday 31 August 2022 23:11 To: CSOUND@LISTSERV.HEANET.IE <CSOUND@LISTSERV.HEANET.IE> Subject: Re: [Csnd] [EXTERNAL] [Csnd] Question to devs about code formatting I too struggling with reading some of her source, but it's mostly because I'm involved in other projects that use more modern formatting. I had once a script that would reformat the entire code base. But nowadays I'm just getting used to it.
Such a script would be easy to reproduce.
On Wed 31 Aug 2022, 8:27 p.m. Aaron Krister Johnson, <akjmicro@gmail.com> wrote:
|
Date | 2022-09-01 01:58 |
From | Aaron Krister Johnson |
Subject | Re: [Csnd] [EXTERNAL] [Csnd] Question to devs about code formatting |
The thing to do for branch merges is just make sure to do formatting separately in one go. Then everyone has to pull in those changes and continue to format per a unified style. Ideally, if you're running a test-suite, you can do formatting as a plugin to your CI pipeline. On Wed, Aug 31, 2022 at 3:40 PM Stephen Kyne <stevek@outlook.ie> wrote:
|
Date | 2022-09-01 06:45 |
From | Victor Lazzarini |
Subject | Re: [Csnd] [EXTERNAL] [Csnd] Question to devs about code formatting |
The merging aspect is an important consideration. I'd prefer if this is not made more complicated.
Prof. Victor Lazzarini
Maynooth University
Ireland
On 31 Aug 2022, at 23:40, Stephen Kyne <stevek@outlook.ie> wrote:
|
Date | 2022-09-01 20:08 |
From | Aaron Krister Johnson |
Subject | Re: [Csnd] [EXTERNAL] [Csnd] Question to devs about code formatting |
Are you worried about large diffs? You can run a formatter on whatever files in the master branch AND the branch to be merged. Then, your diff is just code (mostly) pure code differences (as opposed to the formatting).On Wed, Aug 31, 2022 at 10:45 PM Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
|