Bug 453217 - KDevelop not honoring .clang-format
Summary: KDevelop not honoring .clang-format
Status: RESOLVED NOT A BUG
Alias: None
Product: kdevelop
Classification: Applications
Component: All editors (show other bugs)
Version: 5.8.220400
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-30 06:12 UTC by Aaron Williams
Modified: 2022-04-30 06:36 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Failing .clang-format file (2.14 KB, text/plain)
2022-04-30 06:12 UTC, Aaron Williams
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aaron Williams 2022-04-30 06:12:49 UTC
Created attachment 148469 [details]
Failing .clang-format file

SUMMARY
***
I have a .clang-format file which specifies that tabs should not be used and that the indentation should be 4 spaces, however I am seeing inconsistent behavior in the editor where it either still inserts tabs or it indents by 2 spaces (or sometimes 1).
***

STEPS TO REPRODUCE
1. Add the attached .clang-format file in the root directory of the project
2. Configure the project source formatter to override the editor indentation mode and select the Clang Format custom script formatter for the C language.
3.  Create a new file, in my case, test.c 
4.  Type the following:
struct test<cr>
{<cr>
(notice indentation is two spaces, not 4)
<tab> (now at four spaces)
one<tab><tab>(notice it indented one space then 2 spaces, not 4.

OBSERVED RESULT
The editor indents by only 2 spaces, not 4. It can be inconsistent, however. Sometimes it does indent by 4 spaces and other times I see it actually inserting a tab character and indenting by 8 instead of using spaces.

EXPECTED RESULT
I expect the editor to always indent to the next tab stop, i.e. 1 to 4 spaces, and always insert spaces.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version:  5.93.0
Qt Version: 5.12.2

ADDITIONAL INFORMATION
Comment 1 Aaron Williams 2022-04-30 06:36:59 UTC
Please disregard. I have two identical projects and was editing the wrong one.