Skip to content

codeformat.py bug #10751

@mbedNoobNinja

Description

@mbedNoobNinja

Description:

When codeformat.py formats *.h or *.c files (#10595) , it reduces file content by deleting not only formating symbols and whitespaces but also the code being formated!

before_codeformat.txt
after_codeformat.txt

and while working on before_codeformat.h codformat.py gives the folowing error:

Parsing: ..\ports\renesas-ra\boards\VK_RA4W1\ra_cfg\fsp_cfg\bsp\bsp_cfg.h as language C
Traceback (most recent call last):
   File "D:\micropython\tools\codeformat.py", line 218, in <module>
     main()
   File "D:\micropython\tools\codeformat.py", line 205, in main
     fixup_c(file)
   File "D:\micropython\tools\codeformat.py", line 136, in fixup_c
     if dedent_stack[-1] >= 0:
        ~~~~~~~~~~~~^^^^
IndexError: list index out of range

Environment:

OS Win 10 (22H2)
Uncrustify 0.72.0_f
Python 3.11.1
Package Version
black 22.12.0
click 8.1.3
colorama 0.4.6
mypy-extensions 0.4.3
pathspec 0.11.0
pip 23.0
platformdirs 2.6.2
pyserial 3.5
setuptools 65.5.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy