Hi, I've made a few improvements to the nissan leaf code (see https://carrott.org/git/Open-Vehicle-Monitoring-System.git/log/refs/heads/ni... and the climate control branch on the same server ) and I noticed it had a mix of code styles. I'd like to reformat it to be consistent (mostly because I can't write consistently formatted code without a code formatter) and wanted to know if there is an agreed format to use -- there is nothing worse than trying to trace changes through a code formatting war in the history? I'm currently using the default mplabx code format configuration which suits me but is different from most of the rest of the OVMS code. Is there a configuration for mplabx I can import? -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.
Tom, I'm afraid the mix of code styles is my fault... there are still parts in the framework I've done in my style, and my style is not always consistent as well. I configured my MPLAB options to get the default style but also occasionally forgot to reformat my work before committing. I've attached my formatting options export from MPLAB IDE, should be importable directly. Please check if you can use this. Regards, Michael Am 20.03.2016 um 02:55 schrieb Tom Parker:
Hi,
I've made a few improvements to the nissan leaf code (see https://carrott.org/git/Open-Vehicle-Monitoring-System.git/log/refs/heads/ni... and the climate control branch on the same server ) and I noticed it had a mix of code styles. I'd like to reformat it to be consistent (mostly because I can't write consistently formatted code without a code formatter) and wanted to know if there is an agreed format to use -- there is nothing worse than trying to trace changes through a code formatting war in the history?
I'm currently using the default mplabx code format configuration which suits me but is different from most of the rest of the OVMS code. Is there a configuration for mplabx I can import?
-- Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
The original code was written in Whitesmiths style, with 2 spaces (not tabs). That is my preferred style, but it is damn hard to find an auto-formatter integrated to an IDE that will support it perfectly. The MPLAB-X IDE does a reasonable job. Short description: 2 spaces indent convert tabs to spaces braces on their own lines The vast majority of the OVMS code follows that. I’ve tried to export my formatting preferences, and attach here, but not sure if it works or not. The whitesmiths.zip is just the formatting editor part of my preferences, and the whitesmiths.zip is my entire preferences. I can’t see the name ‘whitesmiths’ anywhere in the exported ZIP files, so really not sure if this export feature works or not. Regards, Mark.
On 25 Mar 2016, at 3:53 AM, Michael Balzer <dexter@expeedo.de <mailto:dexter@expeedo.de>> wrote:
Tom,
I'm afraid the mix of code styles is my fault... there are still parts in the framework I've done in my style, and my style is not always consistent as well.
I configured my MPLAB options to get the default style but also occasionally forgot to reformat my work before committing.
I've attached my formatting options export from MPLAB IDE, should be importable directly. Please check if you can use this.
Regards, Michael
Am 20.03.2016 um 02:55 schrieb Tom Parker:
Hi,
I've made a few improvements to the nissan leaf code (see https://carrott.org/git/Open-Vehicle-Monitoring-System.git/log/refs/heads/ni... <https://carrott.org/git/Open-Vehicle-Monitoring-System.git/log/refs/heads/nissan-leaf> and the climate control branch on the same server ) and I noticed it had a mix of code styles. I'd like to reformat it to be consistent (mostly because I can't write consistently formatted code without a code formatter) and wanted to know if there is an agreed format to use -- there is nothing worse than trying to trace changes through a code formatting war in the history?
I'm currently using the default mplabx code format configuration which suits me but is different from most of the rest of the OVMS code. Is there a configuration for mplabx I can import?
-- Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
<mplab-formatting.zip><dexter.vcf>_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk <mailto:OvmsDev@lists.teslaclub.hk> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev <http://lists.teslaclub.hk/mailman/listinfo/ovmsdev>
On 03/28/2016 02:20 AM, Mark Webb-Johnson wrote:
The original code was written in Whitesmiths style, with 2 spaces (not tabs).
...
I’ve tried to export my formatting preferences, and attach here, but not sure if it works or not. The whitesmiths.zip is just the formatting editor part of my preferences, and the whitesmiths.zip is my entire preferences. I can’t see the name ‘whitesmiths’ anywhere in the exported ZIP files, so really not sure if this export feature works or not.
Seemed to work. I've reformatted vehicle_nissan_leaf and sent a pull request. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.
Looks good. Merged.
On 10 Apr 2016, at 6:38 PM, Tom Parker <tom@carrott.org> wrote:
On 03/28/2016 02:20 AM, Mark Webb-Johnson wrote:
The original code was written in Whitesmiths style, with 2 spaces (not tabs).
...
I’ve tried to export my formatting preferences, and attach here, but not sure if it works or not. The whitesmiths.zip is just the formatting editor part of my preferences, and the whitesmiths.zip is my entire preferences. I can’t see the name ‘whitesmiths’ anywhere in the exported ZIP files, so really not sure if this export feature works or not.
Seemed to work. I've reformatted vehicle_nissan_leaf and sent a pull request.
-- This message has been scanned for viruses and dangerous content by MailScanner <http://www.mailscanner.info/>, and is believed to be clean. _______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
participants (3)
-
Mark Webb-Johnson -
Michael Balzer -
Tom Parker