Skip to content

Commit

Permalink
tools: Add note about uncrustify versions.
Browse files Browse the repository at this point in the history
Uncrustify versions are not mutually compatible:

1. Version 0.73 or newer produce slightly different formatting. It may be
possible to tweak these by adding more config items, but this will cause
older versions to error out with 'Unknown option'.

2. Version 0.75 prints a range of deprecation warnings due to config file
changes, and returns a non-zero exit code. These are actually fixable
as most are the default value, and pp_indent has changed from 'true' to '1'
which is backwards compatible. However issue 1 remains, so probably better
to have it fail explicitly.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
  • Loading branch information
projectgus committed Oct 4, 2022
1 parent 0ee877a commit bdac827
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CODECONVENTIONS.md
Expand Up @@ -65,6 +65,10 @@ changes to the correct style. Without arguments this tool will reformat all
source code (and may take some time to run). Otherwise pass as arguments to
the tool the files that changed and it will only reformat those.

**Important**: Use only [uncrustify](https://github.com/uncrustify/uncrustify)
v0.71 or v0.72 for MicroPython. Different uncrustify versions produce slightly
different formatting, and the configuration file formats are often incompatible.

Python code conventions
=======================

Expand Down
3 changes: 3 additions & 0 deletions tools/uncrustify.cfg
@@ -1,5 +1,8 @@
# Uncrustify-0.71.0_f

# IMPORTANT: Output is different if using Uncrustify 0.73 or newer, and config file format has changed in newer versions.
# Use version 0.71 or 0.72 to get matching code formatting.

#
# General options
#
Expand Down

0 comments on commit bdac827

Please sign in to comment.