[QGIS-Developer] pre-commit for code-formatting
Jean Felder
jean.felder at oslandia.com
Thu Dec 12 07:42:41 PST 2024
Le 12/12/2024 à 16:38, Even Rouault via QGIS-Developer a écrit :
>
>
> Le 12/12/2024 à 16:33, Julien Cabieces via QGIS-Developer a écrit :
>> Not a great fan of this approach, It looks like complicated to me, I would prefer the old behavior.
>>
>> Those automatic PR force also contributor to rebase before pushing new
>> modification to their branch. And if they have modified area of code
>> which have been reformatted, they get conflicts.
>>
>> automatic pre-commit commits brings more difficulties than what it
>> solves IMHO.
>
> I also tend to agree on that. On other projects I'm involved too
> (GDAL, PROJ, shapelib, libtiff) where we have put in place pre-commit,
> we just have a CI check that checks the formatting is OK. This
> requires a bit of education to first time contributors, but pointing
> to the documentation with clear instructions on how to setup
> pre-commit should be good enough.
> https://github.com/qgis/QGIS/edit/master/.github/PULL_REQUEST_TEMPLATE.md
> could also have some words about it
>
> Like in
> https://github.com/OSGeo/gdal/edit/master/.github/PULL_REQUEST_TEMPLATE.md
> , " - [ ] Make sure code is correctly formatted (cf [pre-commit
> configuration](https://gdal.org/development/dev_practices.html#commit-hooks))"
>
On second thoughts, I agree with Julien and Even.
Jean
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_0x12722DC64D3F429E.asc
Type: application/pgp-keys
Size: 2444 bytes
Desc: OpenPGP public key
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20241212/afbe3c46/attachment-0001.key>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 665 bytes
Desc: OpenPGP digital signature
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20241212/afbe3c46/attachment-0001.sig>
More information about the QGIS-Developer
mailing list