(codingstyle): uncrustify configuration messes up license headers for non-free repositories
Summary
- The
cmt_reflow_mode
option set to 2 (see https://github.com/uncrustify/uncrustify/blob/master/etc/defaults.cfg#L2827) andcmt_width
set to 120 in uncrustify configuration mess up the license headers for non-free projects - The expected header that will be correctly parsed by sheldon regexes should have this form:
/************************************************************************
* Copyright (C) 2021-2022 IRCAD France - All rights reserved.
*
* This file is part of Project.
*
* Project can not be copied, modified and/or distributed without
* the express permission of IRCAD France.
*
***********************************************************************/
- When reflow is at its current value (2), the header gets reformatted to:
/************************************************************************
* Copyright (C) 2021-2022 IRCAD France - All rights reserved.
*
* This file is part of Project.
*
* Project can not be copied, modified and/or distributed without the express permission of IRCAD France.
*
***********************************************************************/
- It then cannot be matched by the LICENSE_NONFREE regex (https://git.ircad.fr/sight/sight-git/-/blob/dev/hooks/codingstyle.py#L76)
- Resulting in the addition of a new header
Dev environment
- OS: Windows
- Uncrustify version 0.73.0
Possible fixes
- Change the value of
cmt_reflow_mode
to 0 (default one)
or
- Update the
LICENSE_NONFREE
regex