pitchfork icon indicating copy to clipboard operation
pitchfork copied to clipboard

No src directory in merged header placement mode?

Open teonnik opened this issue 6 years ago • 2 comments

Thanks for creating PFL! The merged header placement rules seem to overlap quite well with build2's canonical project layout. However, I notice two differences, in build2:

  1. the src project is omitted and the name of the project is used directly (skips one level of nesting).
  2. The tests directory is only for functional/integration tests since tests are placed next to headers/sources in the merged mode.

Any thoughts on these?

teonnik avatar Jan 18 '19 08:01 teonnik

My thoughts as an outsider:

  1. I was under the impression that src was used for source files and private headers. In that case there shouldn't need to be another subfolder
  2. I don't know.

FireFlyForLife avatar Jan 28 '19 23:01 FireFlyForLife

  1. This does seem reasonable, but I don't think pitchfork should allow for it. Pitchfork should not be a perfect fit for all existing layouts, but should be a single, mostly prescriptive layout. There is some variety in arrangement of headers and sources, but AFAICT, this is because there's really no consensus in the community on how to arrange them, and the different styles are fundamentally different. Having or not having a top level src/ are practically the same, so allowing for both makes the project structure more complicated for (IMO) little benefit.
  2. Yes, this is an excellent idea, which I believe is currently allowed, albeit somewhat underspecified. The merged test placement asks for unit tests to be in the same directory as normal source code. It's not 100% clear that integration or other kinds of tests should still be under the tests/ directory, though.

Quincunx271 avatar Mar 17 '19 14:03 Quincunx271