clang-format config for Pawn

Started by SA:MP, May 05, 2023, 08:51 AM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

FrankJScott

In response to the man inquiring about dose calculation formula for animals, adh desmopressin, enclomiphene citrate reviews, adenosine a2a, 1 tryptophan, cancer dna damage, jak stat receptor, name of 9 essential amino acids, hsp inhibitor, 2dg inhibitor,  I highly recommend this bonuses for amino acid forum or sglt2 transporter, cfse fluorescence, pka inhibitor, repair damaged dna, potassium acetate solution, prolyl hydroxylase hif, azaperone for sale, sglt2i inhibitors, methyl jasmonate, cu chlorophyllin, alongside all this more info on amino acid forum not forgetting sites such as thyroid hormone beta receptor, molarity weight calculator, cam kinase 2, selegiline tablet, rapamycin protein, polyphenolic compound, adenosine a2a receptor antagonist, ppar inhibitor, nadh plus, wnt pathways, bearing in mind this more about the author for amino acid site which is also great. Also, have a look at this find about amino acid info which is worth considering with asunaprevir, acid l aspartic, parp2 inhibitor, about antibiotic resistance, g protein coupled receptor location, sodium d aspartic acid, evogliptin tartrate, hdac activity assay, qpcr master mix components, dhea side effects in females, which is worth considering with this continue reading for amino acid details as well as tideglusib for sale, sodium chlorophyllin, ibutamoren peptide, akt signal pathway, phd2 inhibitor,  learn more here about not to mention azelaic acid solubility in ethanol, compound antibiotics, dna repair methods, trp aminoacid, 4 antibiotics,  for good measure. Check more @ Excellent Natural Pet Supplements Guide 2b9d684

FrankJScott

In reply to the person talking about botox treatment for your hair, skin dermal fillers, best body treatments, botox muscles, dermaplane peel, about face laser, lip wrinkles, treatment for skin care, filler botox before after, laser treatment for skin tightening,  I highly suggest this recommended non surgical male enhancement sarasota link or good lip filler, best facial peels, best botox treatment near me, vampire lift, light therapy for wrinkles, skin rejuvenation micro needling, define botox, best natural face fillers, microneedling facial, facial dermal fillers, not forgetting sites such as this new penile treatment sarasota link not to mention best wrinkle fillers, botox can be used for, best filler for, priapus shot for men, therapy skin, dermal fillers for lines around mouth, skin peel treatment for face, double chin fat reduction treatment, botox dermal fillers, facial services, not forgetting sites such as this super fast reply on penile injections sarasota site which is also great. Also, have a look at this this guy on prp therapy for mens sexual health sarasota info not to mention skin face peel, derm facial, laser skin rejuvenation, skin care laser treatment, lines treatment, med spa sarasota fl, lip lines wrinkles, fillers for lines, botox enhancement, skin tightening microneedling, on top of this top rated erectile dysfunction treatment sarasota info not forgetting sites such as lip fillers sarasota, best cellulite reduction, best dermal fillers, best smile lines treatment, healthy botox,  learn more here on alongside all botox before after, wrinkle reduction laser treatment, led light therapy best, microneedling rejuvenation, best laser treatment for wrinkles,  for good measure. Check more @ Great Non-Invasive Erectile Dysfunction Solutions Sarasota Site 68456a0

SA:MP

clang-format config for Pawn

I recently realised clang-format (the clang formatting tool for C++, Java, ObjC and a few other languages) quite happily reads most Pawn code.



You can check out the tool here: https://clang.llvm.org/docs/ClangFormat.html and play with configs here: https://clangformat.com/ or here: https://zed0.co.uk/clang-format-configurator/



So, being a lover of conventions and strict formatting, I attempted to write a clang format config for Pawn based on the conventions that the community have adopted over the years.



It looks like this:







And the configuration is:




Code:

---
BasedOnStyle: WebKit
IndentWidth: 4
---
Language: Cpp
AlignAfterOpenBracket: DontAlign
BreakBeforeBraces: Allman
BreakConstructorInitializers: BeforeColon
SpaceBeforeCtorInitializerColon: false
SpaceBeforeInheritanceColon: false
KeepEmptyLinesAtTheStartOfBlocks: false
MaxEmptyLinesToKeep: 1
SortIncludes: true
SpaceBeforeAssignmentOperators: false

The only issue, as you can see in the gif above, foreach is broken and I can't figure out a solution for it (outside of writing my own formatter - which was doing, and may continue).



If anyone wants to contribute, go ahead! It would be nice to have a universal format that is also enforced by a tool that can eventually be implemented into the Pawn Tools for VS Code extension so source code is formatted upon saving the file to save time while writing.

Source: clang-format config for Pawn