Replies: 4 comments
-
Lots of questions. Lots of suggestions. Have you read the https://github.com/ksh93/ksh/blob/dev/README.md which is the main page for this repo? See Policy section especially Policy 7. There is a lot of drama behind some of those policies decisions and lessons learned from the failed ksh2020 project (at least from my understanding as I can only speak for myself). The ksh2020 project tried implementing/imposing many of those standardization/uniformity concepts, guidelines, and tools to the detriment of the community and ksh's code base. Yes, I do realize that a tool is a tool and nothing more; it is the hand that wields it. I am grateful that @McDutchie has taken over leadership and maintenance of the KornShell interpreter. Additionally, @McDutchie has stated some more about coding styles at #614 which you are aware. To help address this "The blame" discussion; no, I personally do not use any tool nor am I aware of others using any on a routine fashion to alter/check code in an automated way. Yes, every line of code is hand coded--line-by-line using a human's ability to try to mimic the author(s) surrounding code style until such time @McDutchie alters this repo's desires. I think of it this way: Michelangelo would not use an automated tool to produce one of his masterpiece sculptures. Only great care would be used to shape such works of art. |
Beta Was this translation helpful? Give feedback.
-
I like using
None. This is all written by hand, the old fashioned way. I fix everything by hand as well. Having said that, I just tried astyle --indent=tab <src/cmd/ksh93/sh/xec.c >xec.c.new and Iike the results. I know there are lots of pre-existing formatting inconsistencies. But fixing them all would make it harder to find why a change was introduced, as However, I'd like to avoid introducing new formatting inconsistencies where possible, and where we change existing code anyway we might as well fix the formatting too. I like tab indentation; I think it's logical and practical, and it works for me. Here's a rough idea for a process, maybe it might work for you:
|
Beta Was this translation helpful? Give feedback.
-
Thanx you all, well I am ignorant of ksh2020 just saw reference to it, I think I saw it once in my distro couple years ago and disapear, but at that time I was not using ksh93 much (was using my own version of ksh88 :-) ) I discover git blame, actually @McDutchie mentionned it a couple of time, and it took some time to makes the neuronal conexion to my brain (learning curve), so I think I will run that before submitting anything. I love astyle (but is far less powerfull than the LLVM tools), but I rekon it is not ideal, because it would fix all the I will try as well for my added code a simple region select pipe to astyle (I will need to tweak it more to get the { style) but I may be close to find a way to normalise the push process. Again thanx for all your explanations. |
Beta Was this translation helpful? Give feedback.
-
I think I have refined the idea, when I have a file updated (ongoing work) not even git added and then not even committed, I can do this
I can focus on the I will hide all that in my git-diff wrapper. Hope I will do better on next PR :) |
Beta Was this translation helpful? Give feedback.
-
Hi All, when submitting PR (like parse.c yesterday) I got blammed, I mean git blammed :) apparently.
Long story short, I work in an environment that ban tabs (syntax directed editor, construct template for if() for() {} etc..) precisely to avoid the tab saga discussion, no tabs mean spaces only, and 1 missing space (or too much space) is visible, and a diff'er can highlight a space, it can not highlight a tab. So a zealous editor (not me on purpose) can goof around with tabs.
Whence a bug is fixed I got to do an whole process to put my work back to the ksh93 coding style, this is manually done and generally involve a dumb pristine vi so I can tabify my cut/paste etc, a cumbersome task, and surely not bullet proof, the yesterday PR was a 1liner
a=1;
kind yet my editor rendered then next line with a tab/space faulty apparently.My question is, what source canonicalisation tools are you using, (in my other projects I use astyle, gdb team use llvm) whatever, any source got to be canonicalised before getting pushed.
I got blamed for a wrong space in a tab in sparse.c, I don't really get it because sparse.c itself has 202 fault space/tab illegal combo meaning so far I can't find a way to automate your coding style.
This reveal the buggy tab/space combo.
🡆
means<space><tab>
🡄
means<tab><space>
<space>
This also catch the crap inside comment one could argue we don't care, but I bet git will still blame me if I goof around in comment (not sure about that).
Yet lines like
Are surely as bad as what I submitted, but may be if they where entered by dgk\bs\bs\bsgod then they are legal ?
parse.c itself has 202 faulty combo
and in sh/ only I got this
I also noticed that (don't remember in which patch though) one did align declarations i.e
becomes
I personnally like it a lot, but then it makes a diff with ancient code, and in some way not different with adding/removing
<space><tab>
goofs ?Is that illegal to sanitize some code as we bump into when fixing code?
I guess this is a never ending discussion, but for tabs I guess we should allow diffs, git is able to ignore tab/space (at least for diff) OR we should have a sanitize process so I could just pipe my source into to produce what you want.
OR may be I just miss a technic that you use to avoid this kind of problems so let me know then will do it.
Beta Was this translation helpful? Give feedback.
All reactions