This is an archive of the discontinued LLVM Phabricator instance.

[clang-format][docs] mark new clang-format configuration options based on which version they would GA
ClosedPublic

Authored by MyDeveloperDay on Sep 24 2021, 10:28 AM.

Details

Summary

Sometimes I see people unsure about which options they can use in specific versions of clang-format because https://clang.llvm.org/docs/ClangFormatStyleOptions.html points to the latest and greatest versions.

The reality is this says its version 13.0, but actually anything we add now, will not be in 13.0 GA but instead 14.0 GA (as 13.0 has already been branched (perhaps really the trunk should get relabelled as soon as the branch is made)

How about we introduce some nomenclature to the Format.h so that we can mark which options in the documentation were introduced for which version? If this seems appealing I'm happing to start going back over the older releases and marking the versions for each option.

Diff Detail

Event Timeline

MyDeveloperDay requested review of this revision.Sep 24 2021, 10:28 AM
MyDeveloperDay created this revision.
MyDeveloperDay edited the summary of this revision. (Show Details)

This is just a very rough idea, feel free to pull it apart.

I like this. Consider only displaying the major version (e.g., clang-format 14 instead of clang-format 14.0.0).

I agree this looks better

I agree this looks better

Full support for that. And for the whole change.

clang/docs/tools/dump_format_style.py
237

I think this was aligned to the opening parenthesis of match(.

If we only had an automatic formatting tool. 😃

clang/include/clang/Format/Format.h
1865

Could we move that into the comment block?

MyDeveloperDay updated this revision to Diff 375177.EditedSep 27 2021, 2:36 AM
MyDeveloperDay marked 2 inline comments as done.

Mark all options with their version,
Move the \version into the comment
Warning if we add new options without a version

I think this is a fairly good representation (there could be a couple that are incorrectly labelled as a later version (if they have been modified), I had to kind of pull the "commit" from git blame then use the sha to determine the first branch. (with git name-rev <commit>), Its more likely to have said it was added in a later release, (especially if the type of the option had changed), but perhaps lets start here and if we see a few that are incorrectly labelled we can work our way back on those, but it was hard to do this for the 130+ options

MyDeveloperDay added inline comments.Sep 27 2021, 2:46 AM
clang/docs/tools/dump_format_style.py
237

I'm going to run this tool through pylint after this commit, as its currently very bad! but I don't want to do this in one go

************* Module dump_format_style
dump_format_style.py:20:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:21:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:24:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:25:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:26:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:29:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:30:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:31:0: W0311: Bad indentation. Found 6 spaces, expected 12 (bad-indentation)
dump_format_style.py:34:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:36:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:37:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:38:0: W0311: Bad indentation. Found 6 spaces, expected 12 (bad-indentation)
dump_format_style.py:39:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:40:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:41:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:42:0: W0311: Bad indentation. Found 6 spaces, expected 12 (bad-indentation)
dump_format_style.py:43:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:44:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:47:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:48:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:49:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:50:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:51:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:52:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:53:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:54:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:55:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:56:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:57:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:61:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:62:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:63:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:64:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:65:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:66:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:67:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:68:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:70:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:71:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:72:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:74:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:77:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:78:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:79:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:80:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:83:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:84:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:85:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:86:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:87:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:90:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:91:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:92:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:93:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:94:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:95:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:96:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:98:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:99:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:100:0: C0301: Line too long (116/100) (line-too-long)
dump_format_style.py:100:0: W0311: Bad indentation. Found 6 spaces, expected 12 (bad-indentation)
dump_format_style.py:102:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:103:0: W0311: Bad indentation. Found 6 spaces, expected 12 (bad-indentation)
dump_format_style.py:105:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:106:0: W0311: Bad indentation. Found 6 spaces, expected 12 (bad-indentation)
dump_format_style.py:107:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:108:0: W0311: Bad indentation. Found 6 spaces, expected 12 (bad-indentation)
dump_format_style.py:110:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:113:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:114:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:115:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:116:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:118:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:119:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:122:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:123:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:124:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:126:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:127:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:132:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:133:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:134:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:135:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:137:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:138:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:141:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:142:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:143:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:144:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:145:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:147:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:148:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:150:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:151:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:152:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:152:0: W0301: Unnecessary semicolon (unnecessary-semicolon)
dump_format_style.py:155:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:156:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:157:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:158:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:160:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:161:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:167:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:168:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:169:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:170:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:171:0: W0311: Bad indentation. Found 6 spaces, expected 12 (bad-indentation)
dump_format_style.py:172:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:173:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:174:0: W0311: Bad indentation. Found 6 spaces, expected 12 (bad-indentation)
dump_format_style.py:175:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:177:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:178:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:179:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:181:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:182:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:183:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:185:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:186:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:187:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:188:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:191:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:192:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:194:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:196:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:197:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:198:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:199:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:200:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:201:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:202:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:204:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:205:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:206:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:207:0: W0311: Bad indentation. Found 6 spaces, expected 12 (bad-indentation)
dump_format_style.py:208:0: W0311: Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
dump_format_style.py:209:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:210:0: W0311: Bad indentation. Found 6 spaces, expected 12 (bad-indentation)
dump_format_style.py:211:0: W0311: Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
dump_format_style.py:212:0: W0311: Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
dump_format_style.py:213:0: W0311: Bad indentation. Found 6 spaces, expected 12 (bad-indentation)
dump_format_style.py:214:0: W0311: Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
dump_format_style.py:215:0: W0311: Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
dump_format_style.py:216:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:217:0: W0311: Bad indentation. Found 6 spaces, expected 12 (bad-indentation)
dump_format_style.py:218:0: W0311: Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
dump_format_style.py:219:0: W0311: Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
dump_format_style.py:220:0: W0311: Bad indentation. Found 12 spaces, expected 20 (bad-indentation)
dump_format_style.py:221:0: W0311: Bad indentation. Found 6 spaces, expected 12 (bad-indentation)
dump_format_style.py:222:0: W0311: Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
dump_format_style.py:223:0: W0311: Bad indentation. Found 6 spaces, expected 12 (bad-indentation)
dump_format_style.py:224:0: W0311: Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
dump_format_style.py:225:0: W0311: Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
dump_format_style.py:226:0: W0311: Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
dump_format_style.py:227:0: W0311: Bad indentation. Found 6 spaces, expected 12 (bad-indentation)
dump_format_style.py:228:0: W0311: Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
dump_format_style.py:229:0: W0311: Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
dump_format_style.py:230:0: W0311: Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
dump_format_style.py:231:0: W0311: Bad indentation. Found 6 spaces, expected 12 (bad-indentation)
dump_format_style.py:232:0: W0311: Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
dump_format_style.py:233:0: W0311: Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
dump_format_style.py:236:0: W0311: Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
dump_format_style.py:237:0: W0311: Bad indentation. Found 12 spaces, expected 20 (bad-indentation)
dump_format_style.py:238:0: W0311: Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
dump_format_style.py:239:0: W0311: Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
dump_format_style.py:240:0: W0311: Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
dump_format_style.py:241:0: W0311: Bad indentation. Found 6 spaces, expected 12 (bad-indentation)
dump_format_style.py:242:0: W0311: Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
dump_format_style.py:243:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:244:0: W0311: Bad indentation. Found 6 spaces, expected 12 (bad-indentation)
dump_format_style.py:245:0: W0311: Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
dump_format_style.py:246:0: W0311: Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
dump_format_style.py:247:0: W0311: Bad indentation. Found 6 spaces, expected 12 (bad-indentation)
dump_format_style.py:248:0: W0311: Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
dump_format_style.py:249:0: W0311: Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
dump_format_style.py:250:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:251:0: W0311: Bad indentation. Found 6 spaces, expected 12 (bad-indentation)
dump_format_style.py:252:0: W0311: Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
dump_format_style.py:253:0: W0311: Bad indentation. Found 6 spaces, expected 12 (bad-indentation)
dump_format_style.py:254:0: W0311: Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
dump_format_style.py:255:0: W0311: Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
dump_format_style.py:256:0: W0311: Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
dump_format_style.py:257:0: C0301: Line too long (107/100) (line-too-long)
dump_format_style.py:257:0: W0311: Bad indentation. Found 12 spaces, expected 20 (bad-indentation)
dump_format_style.py:258:0: W0311: Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
dump_format_style.py:259:0: W0311: Bad indentation. Found 12 spaces, expected 20 (bad-indentation)
dump_format_style.py:261:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:262:0: W0311: Bad indentation. Found 6 spaces, expected 12 (bad-indentation)
dump_format_style.py:263:0: W0311: Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
dump_format_style.py:264:0: W0311: Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
dump_format_style.py:265:0: W0311: Bad indentation. Found 6 spaces, expected 12 (bad-indentation)
dump_format_style.py:266:0: W0311: Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
dump_format_style.py:267:0: W0311: Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
dump_format_style.py:268:0: W0311: Bad indentation. Found 6 spaces, expected 12 (bad-indentation)
dump_format_style.py:271:0: W0311: Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
dump_format_style.py:272:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:273:0: W0311: Bad indentation. Found 6 spaces, expected 12 (bad-indentation)
dump_format_style.py:274:0: W0311: Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
dump_format_style.py:275:0: W0311: Bad indentation. Found 6 spaces, expected 12 (bad-indentation)
dump_format_style.py:276:0: W0311: Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
dump_format_style.py:277:0: W0311: Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
dump_format_style.py:278:0: W0311: Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
dump_format_style.py:279:0: W0311: Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
dump_format_style.py:279:0: C0325: Unnecessary parens after 'if' keyword (superfluous-parens)
dump_format_style.py:280:0: W0311: Bad indentation. Found 12 spaces, expected 20 (bad-indentation)
dump_format_style.py:281:0: W0311: Bad indentation. Found 12 spaces, expected 20 (bad-indentation)
dump_format_style.py:282:0: W0311: Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
dump_format_style.py:283:0: W0311: Bad indentation. Found 12 spaces, expected 20 (bad-indentation)
dump_format_style.py:283:0: W0301: Unnecessary semicolon (unnecessary-semicolon)
dump_format_style.py:284:0: W0311: Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
dump_format_style.py:285:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:286:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:288:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:289:0: W0311: Bad indentation. Found 4 spaces, expected 8 (bad-indentation)
dump_format_style.py:293:0: W0311: Bad indentation. Found 6 spaces, expected 12 (bad-indentation)
dump_format_style.py:294:0: W0311: Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
dump_format_style.py:295:0: W0311: Bad indentation. Found 6 spaces, expected 12 (bad-indentation)
dump_format_style.py:296:0: W0311: Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
dump_format_style.py:297:0: W0311: Bad indentation. Found 6 spaces, expected 12 (bad-indentation)
dump_format_style.py:298:0: W0311: Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
dump_format_style.py:299:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:312:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
dump_format_style.py:1:0: C0114: Missing module docstring (missing-module-docstring)
dump_format_style.py:19:5: W1514: Using open without explicitly specifying an encoding (unspecified-encoding)
dump_format_style.py:23:0: C0116: Missing function or method docstring (missing-function-docstring)
dump_format_style.py:23:26: W0621: Redefining name 'contents' from outer scope (line 307) (redefined-outer-name)
dump_format_style.py:24:16: C0209: Formatting a regular string which could be a f-string (consider-using-f-string)
dump_format_style.py:25:12: C0209: Formatting a regular string which could be a f-string (consider-using-f-string)
dump_format_style.py:28:0: C0116: Missing function or method docstring (missing-function-docstring)
dump_format_style.py:37:36: W0621: Redefining name 'f' from outer scope (line 19) (redefined-outer-name)
dump_format_style.py:37:9: W1514: Using open without explicitly specifying an encoding (unspecified-encoding)
dump_format_style.py:37:36: C0103: Variable name "f" doesn't conform to snake_case naming style (invalid-name)
dump_format_style.py:39:4: C0103: Variable name "cf" doesn't conform to snake_case naming style (invalid-name)
dump_format_style.py:46:0: C0116: Missing function or method docstring (missing-function-docstring)
dump_format_style.py:48:2: R1705: Unnecessary "elif" after "return" (no-else-return)
dump_format_style.py:60:0: C0116: Missing function or method docstring (missing-function-docstring)
dump_format_style.py:61:2: R1705: Unnecessary "elif" after "return" (no-else-return)
dump_format_style.py:76:0: C0116: Missing function or method docstring (missing-function-docstring)
dump_format_style.py:82:0: C0116: Missing function or method docstring (missing-function-docstring)
dump_format_style.py:83:2: W0621: Redefining name 'indent' from outer scope (line 82) (redefined-outer-name)
dump_format_style.py:84:2: C0103: Variable name "s" doesn't conform to snake_case naming style (invalid-name)
dump_format_style.py:89:0: C0115: Missing class docstring (missing-class-docstring)
dump_format_style.py:89:0: R0205: Class 'Option' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance)
dump_format_style.py:90:27: W0622: Redefining built-in 'type' (redefined-builtin)
dump_format_style.py:100:6: C0103: Variable name "s" doesn't conform to snake_case naming style (invalid-name)
dump_format_style.py:100:10: C0209: Formatting a regular string which could be a f-string (consider-using-f-string)
dump_format_style.py:103:6: C0103: Variable name "s" doesn't conform to snake_case naming style (invalid-name)
dump_format_style.py:103:10: C0209: Formatting a regular string which could be a f-string (consider-using-f-string)
dump_format_style.py:106:6: C0103: Variable name "s" doesn't conform to snake_case naming style (invalid-name)
dump_format_style.py:106:18: C0209: Formatting a regular string which could be a f-string (consider-using-f-string)
dump_format_style.py:108:6: C0103: Variable name "s" doesn't conform to snake_case naming style (invalid-name)
dump_format_style.py:108:18: C0209: Formatting a regular string which could be a f-string (consider-using-f-string)
dump_format_style.py:89:0: R0903: Too few public methods (1/2) (too-few-public-methods)
dump_format_style.py:112:0: C0115: Missing class docstring (missing-class-docstring)
dump_format_style.py:112:0: R0205: Class 'NestedStruct' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance)
dump_format_style.py:112:0: R0903: Too few public methods (1/2) (too-few-public-methods)
dump_format_style.py:121:0: C0115: Missing class docstring (missing-class-docstring)
dump_format_style.py:121:0: R0205: Class 'NestedField' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance)
dump_format_style.py:127:11: C0209: Formatting a regular string which could be a f-string (consider-using-f-string)
dump_format_style.py:121:0: R0903: Too few public methods (1/2) (too-few-public-methods)
dump_format_style.py:131:0: C0115: Missing class docstring (missing-class-docstring)
dump_format_style.py:131:0: R0205: Class 'Enum' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance)
dump_format_style.py:131:0: R0903: Too few public methods (1/2) (too-few-public-methods)
dump_format_style.py:140:0: C0115: Missing class docstring (missing-class-docstring)
dump_format_style.py:140:0: R0205: Class 'NestedEnum' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance)
dump_format_style.py:148:4: C0103: Variable name "s" doesn't conform to snake_case naming style (invalid-name)
dump_format_style.py:148:8: C0209: Formatting a regular string which could be a f-string (consider-using-f-string)
dump_format_style.py:150:4: C0103: Variable name "s" doesn't conform to snake_case naming style (invalid-name)
dump_format_style.py:151:4: C0103: Variable name "s" doesn't conform to snake_case naming style (invalid-name)
dump_format_style.py:140:0: R0903: Too few public methods (1/2) (too-few-public-methods)
dump_format_style.py:154:0: C0115: Missing class docstring (missing-class-docstring)
dump_format_style.py:154:0: R0205: Class 'EnumValue' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance)
dump_format_style.py:161:11: C0209: Formatting a regular string which could be a f-string (consider-using-f-string)
dump_format_style.py:154:0: R0903: Too few public methods (1/2) (too-few-public-methods)
dump_format_style.py:166:0: C0116: Missing function or method docstring (missing-function-docstring)
dump_format_style.py:169:4: W0621: Redefining name 'indent' from outer scope (line 82) (redefined-outer-name)
dump_format_style.py:175:11: C0209: Formatting a regular string which could be a f-string (consider-using-f-string)
dump_format_style.py:190:0: C0116: Missing function or method docstring (missing-function-docstring)
dump_format_style.py:196:2: W0621: Redefining name 'options' from outer scope (line 301) (redefined-outer-name)
dump_format_style.py:190:0: R0914: Too many local variables (19/15) (too-many-locals)
dump_format_style.py:191:2: C0115: Missing class docstring (missing-class-docstring)
dump_format_style.py:191:2: R0205: Class 'State' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance)
dump_format_style.py:191:2: R0903: Too few public methods (0/2) (too-few-public-methods)
dump_format_style.py:207:9: R1714: Consider merging these comparisons with "in" to "line in ('struct FormatStyle {', 'struct IncludeStyle {')" (consider-using-in)
dump_format_style.py:298:24: C0209: Formatting a regular string which could be a f-string (consider-using-f-string)
dump_format_style.py:190:0: R0912: Too many branches (38/12) (too-many-branches)
dump_format_style.py:190:0: R0915: Too many statements (94/50) (too-many-statements)
dump_format_style.py:301:23: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)
dump_format_style.py:301:23: W1514: Using open without explicitly specifying an encoding (unspecified-encoding)
dump_format_style.py:302:24: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)
dump_format_style.py:302:24: W1514: Using open without explicitly specifying an encoding (unspecified-encoding)
dump_format_style.py:305:0: C0103: Constant name "options_text" doesn't conform to UPPER_CASE naming style (invalid-name)
dump_format_style.py:307:11: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)
dump_format_style.py:307:11: W1514: Using open without explicitly specifying an encoding (unspecified-encoding)

--------------------------------------------------------------------

Your code has been rated at -2.25/10 (previous run: -2.25/10, +0.00)
clang/include/clang/Format/Format.h
1865

yes let me do that its a better idea

2946

I think there is a bug here as ReflowComments is not in the bool operator==(const FormatStyle &R)

clang/docs/tools/dump_format_style.py
225

This needs to be escaped, doesn't it?

225

This shouldn't be needed, or?

clang/include/clang/Format/Format.h
747

The dot should be kept. Also somehow the output has the dot, but also an A afterwards.

2549

A Space is missing in that block.

2947

Some whitespace changes here.

And Version 14 is definitely wrong. It was already in 4 and not in 3.8, don't know how many version were in between.

3007

Was also already in 4, but just as bool.

MyDeveloperDay marked 6 inline comments as done.
  • Minor available version corrections
  • Addressing review comments
clang/docs/tools/dump_format_style.py
225

I don't think it means any character in a [...] but I'm not a regex expert

https://regex101.com/r/0e08JP/1

It is needed because prior to 4.0 we had 3.3->3.9

clang/include/clang/Format/Format.h
2947

This revision is now accepted and ready to land.Sep 27 2021, 11:41 AM
This revision was landed with ongoing or failed builds.Sep 28 2021, 3:42 AM
This revision was automatically updated to reflect the committed changes.