vector-of-bool / pitchfork

Pitchfork is a Set of C++ Project Conventions
MIT License
1.1k stars 56 forks source link

non-source-code files in source directories #49

Open justusranvier opened 11 months ago

justusranvier commented 11 months ago

Section 3.3 of the specification states "No non-source-code files will should be placed or generated in any subdirectories of a source directory." however this conflicts with the requirements of some development tools.

In particular, files such as .clang-tidy, .clang-format and Doxyfile must be placed in particular locations in the source tree relative to files to which they apply.

It seems like the intent here is to exclude binary artifacts but the wording goes beyond that.

SiebrenW commented 9 months ago

Usually for one project you should only handle a single .clang-tidy, .clang-format or .clangd file, which you should put in the root of the project. If you handle different .clang-format files for instance, you're not really working "correctly" anyways so the "correct" guideline for a folder structure doesn't apply anyways. For Doxyfile you can actually specify the relative path and put this config anywhere you like (I usually put it in docs/doxygen/myconfig.conf and set the INPUT variable in there to ../../src and ../../include or the like)

justusranvier commented 9 months ago

I can not understand what line of reasoning would lead one to conclude that it's only correct to have a single .clang-tidy or .clang-format file per project.

Why do are these tools coded to allow configuration files to inherit and extend/modify settings from configuration files in parent directories if that's an incorrect use of them?

SiebrenW commented 9 months ago

You make it sound as if it's the sole intent of these files to be used that way. It's a feature for a use case that shouldn't have been applicable, because it's ill advised to make exceptions for one portion of the code to keep it consistent.

Other than that, use your own discretion. If you think you need that, then don't let me or this guide tell you what to do. If you think you should have an extra clang-tidy in other directories then go ahead, but it's not a typical use case nor would I advice for it.