2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 <2021> 2022 2023 2024 2025 | Index | 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 <2021> 2022 2023 2024 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: file format enforcing? |
From: | Hugo Slepicka via Core-talk <core-talk at aps.anl.gov> |
To: | Michael Davidsaver <mdavidsaver at gmail.com> |
Cc: | "EPICS core-talk \(core-talk at aps.anl.gov\)" <core-talk at aps.anl.gov> |
Date: | Sun, 18 Apr 2021 19:45:00 -0700 |
On 4/18/21 8:20 AM, Freddie Akeroyd - STFC UKRI via Core-talk wrote:
> Git client side hooks might be another option, but some mechanism to deploy/update them in the local .git/hooks directory would be needed. Creating links back to files in the main repository seems to be one option used, but the links still need to be initially created by the developer or by some other mechanism.
>
> Such an approach might need a little care on windows - it does support symbolic links, but pre-windows 10 these could only be created by an administrator and even with windows 10 you need to have enabled "developer mode" to create them without a raised privilege console. Other options would be a hard link to each file (but this might get unmade if a file was deleted and recreated) or creating a directory junction to link the local .git/hooks directory to a folder of hooks in the repository
imo. one important target "audience" for this sort of style check will be new (to Base) developers.
It seems a stretch to expect newcomers to enable custom git hook scripts before starting.
> Freddie
>
>> -----Original Message-----
>> From: Core-talk <core-talk-bounces at aps.anl.gov> On Behalf Of Michael
>> Davidsaver via Core-talk
>> Sent: 17 April 2021 19:11
>> To: Zimoch Dirk (PSI) <dirk.zimoch at psi.ch>
>> Cc: 'core-talk at aps.anl.gov' <core-talk at aps.anl.gov>
>> Subject: Re: file format enforcing?
>>
>> On 4/17/21 10:46 AM, Zimoch Dirk (PSI) via Core-talk wrote:
>>> Hi folks,
>>>
>>> My compiler is throwing new warnings at me:
>>> freeList.h:44:2: warning: no newline at end of file (committed
>>> 2021-03-08)
>>
>> Ah, I didn't notice this.
>>
>> https://github.com/epics-base/epics-base/pull/121/files#diff-
>> 9154fa56cfad3841361b708dba2417a28e7c1686f827d8268412e9d50cb1b6b2
>> R44
>>
>>> Is there a way to enforce some file format conventions before accepting
>> source files in git?
>>> I would prefer to enforce:
>>> 1. No files without newline at the end.
>>> 2. No source code files with tabs in them.
>>> 3. Consistent indents (4?)
>>> 4. No whitespace at end of line. (Ok, that's a minor thing actually)
>>
>> launchpad.net doesn't allow custom git hook scripts, which would be the
>> obvious way to enforce this. (neither does the github.com free service)
>>
>> The next best thing would be adding a style/linter check to the CI builds.
>>
>> I'm a bit hesitant to enforce too many style checks, although what you list
>> seems reasonable.
>
> This email and any attachments are intended solely for the use of the named recipients. If you are not the intended recipient you must not use, disclose, copy or distribute this email or any of its attachments and should notify the sender immediately and delete this email from your system. UK Research and Innovation (UKRI) has taken every reasonable precaution to minimise risk of this email or any attachments containing viruses or malware but the recipient should carry out its own virus and malware checks before opening the attachments. UKRI does not accept any liability for any losses or damages which the recipient may sustain due to presence of any viruses. Opinions, conclusions or other information in this message and attachments that are not related directly to UKRI business are solely those of the author and do not represent the views of UKRI.
>