Git Product home page Git Product logo

Comments (6)

m-kuhn avatar m-kuhn commented on August 15, 2024 1

For reference, for QField clang-format is used with the following options which offer a (IMHO) acceptable compatibility. It's been a while, so maybe nowadays even better things are possible: https://github.com/opengisch/QField/blob/master/.clang-format with https://github.com/opengisch/QField/blob/master/.pre-commit-config.yaml#L43-L47

from qgis-enhancement-proposals.

3nids avatar 3nids commented on August 15, 2024

A big +1 from me.

We've made some tries in the past and I believe we can get close to no-modification of our source files.

The main issue we had was the indent of access modifiers (see https://bugs.llvm.org/show_bug.cgi?id=19056 and https://reviews.llvm.org/D60225) which was finally solved in 2021 (see https://reviews.llvm.org/rG2a42c759ae7bb09dd448d188138f310d014fcab6).
This would mean LLVM 12+ and this is probably acceptable now!

Another point regarding modification of headers is … sipify… As you probably don't want to dig into this, that's a good motivation to stick to our current format :) (just the format, not the tool!)

And that would mean one tool to rule all the branches, otherwise, we'll probably live with astyle with the current branches until they are not maintained anymore and clang-format for the new ones, but that's not a big deal.

from qgis-enhancement-proposals.

sbrunner avatar sbrunner commented on August 15, 2024

+1 to use a simple pre-commit for this kind of task :-)

from qgis-enhancement-proposals.

Gustry avatar Gustry commented on August 15, 2024

Precommit looks good, from a few projets using it.

And that would mean one tool to rule all the branches, otherwise, we'll probably live with astyle with the current branches until they are not maintained anymore and clang-format for the new ones, but that's not a big deal.

The backport bot will mainly fail if the formatting is different between active branches so it will require a lof manual backport.

from qgis-enhancement-proposals.

elpaso avatar elpaso commented on August 15, 2024

Precommit looks good, from a few projets using it.

And that would mean one tool to rule all the branches, otherwise, we'll probably live with astyle with the current branches until they are not maintained anymore and clang-format for the new ones, but that's not a big deal.

The backport bot will mainly fail if the formatting is different between active branches so it will require a lof manual backport.

Right, I guess we will need to reformat all the "active" branches.

from qgis-enhancement-proposals.

lbartoletti avatar lbartoletti commented on August 15, 2024

A big +1 from me too. I use it on various projects and it's excellent (especially since it's been stabilized since versions ~ >= 12).

fyi, I've discovered a tool - Clang Format Detector that "promises" to convert file styles to .clang-format. I don't have a truly satisfactory result yet, but it's pretty close.

from qgis-enhancement-proposals.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.