Comments (12)
(from #39) At this time I prefer default rustfmt settings as code style (https://rust-lang.github.io/rustfmt/?version=master&search=) even in C/C++ code (where applicable, of course)
I suggest adapt rustfmt defaults to clang format
from flipperzero-firmware.
@officialdarksheao can I assign you to this task?
from flipperzero-firmware.
We have a lot of thirdparty SDK code in target_f*
folders now, I don't like its style and maybe we should ignore it
from flipperzero-firmware.
@nikita-b can I assign you to this task?
from flipperzero-firmware.
@glitchcore Yes, sure
from flipperzero-firmware.
@nikita-b Do you still want to do this task?
from flipperzero-firmware.
CI pipeline to prevent merge of pull requests if the style check was not successful
Here's an example of an action that executes clang-format
on each push. If the code changes after formatting, this action creates an additional commit with a fixed commit message ("apply clang-format").
What do you think about this approach?
from flipperzero-firmware.
@glitchcore Yes, sorry for the delay. I'll start today.
from flipperzero-firmware.
CI pipeline to prevent merge of pull requests if the style check was not successful
Here's an example of an action that executes
clang-format
on each push. If the code changes after formatting, this action creates an additional commit with a fixed commit message ("apply clang-format").What do you think about this approach?
Wouldn't it be better if a pre-commit hook ran clang-format check, detected if the output differed from the input file and notified the developer with a warning and a hint to run clang-format manually?
This way developers are encouraged to periodically (or automatically) run clang-format themselves and even more importantly, will prevent pollution of git history with formatting commits.
from flipperzero-firmware.
Wouldn't it be better if a pre-commit hook ran clang-format check, detected if the output differed from the input file and notified the developer with a warning and a hint to run clang-format manually?
Since the pre-commit hooks run locally on the developer's machine, and the clang-format parameters change from version to version, we'll need to make sure that all developers have the same clang-format version.
from flipperzero-firmware.
Formatting errors can be detected with the following command:
clang-format --dry-run --Werror --ferror-limit=1 <file>
from flipperzero-firmware.
CI pipeline to prevent merge of pull requests if the style check was not successful
Here's an example of an action that executes
clang-format
on each push. If the code changes after formatting, this action creates an additional commit with a fixed commit message ("apply clang-format").
What do you think about this approach?Wouldn't it be better if a pre-commit hook ran clang-format check, detected if the output differed from the input file and notified the developer with a warning and a hint to run clang-format manually?
This way developers are encouraged to periodically (or automatically) run clang-format themselves and even more importantly, will prevent pollution of git history with formatting commits.
Pre-commit hook is a great idea, but I think it'll be more complicated for contributors with the Windows machine and new contributors. I suggest starting with CI and git history won't be a problem if we squash commits before a merge.
from flipperzero-firmware.
Related Issues (20)
- [DEV] NFC stuck at reading screen when trying to read Mi Band chip. HOT 2
- Incorrect subghz frequency bands for Dominican Republic region (DO) HOT 1
- Electra lfrfid protocol bug? HOT 8
- Flipper zero
- hey can you please give an IPA file? im on iOS 15 and the app needs iOS 16 (Unless its using newer API) HOT 1
- LFRFID: Indala E9 Support HOT 1
- R/W NFC file while emulating it HOT 1
- CC1101: Impossible to send a long preamble HOT 2
- Flipper crashes when continuously opening and closing the Passport screen
- CC1101: Fixed-length packet mode not supported HOT 3
- CC1101: Impossible to change registers without resetting the device HOT 1
- A JavaScript module for GPIO
- PIN code boot ? HOT 1
- devboard_flash ARGS="-c dev" works with FBT, but not with uFBT HOT 5
- MIFARE Ultralight C hex dump shows bogus data for locked pages HOT 1
- U2F not working at all HOT 6
- Support multiple devices for BT remote HOT 3
- Wrong allowed frequency for SM HOT 4
- Documentation suggestion: mention most 125khz RFID a person receives are read-only
- LFRFID: chubb 125khz tag support HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flipperzero-firmware.