EQMG/Acid

.clang_format inconsistencies

mattparks opened this issue · 1 comments

Clang Format currently has three formatting issues:

  1. Inheritance will wrap into the class line.
  2. AllowShortFunctionsOnASingleLine will shorten constructors and some methods but not others.
  3. Some parameters get split to create 2 new lines instead of 1.
// Correct
class Texture : 
	public NonCopyable, 
	public Descriptor, 
	public Resource{}
Json::Json(Metadata *metadata) : 
	Metadata("", "")
{
	AddChildren(metadata, this);
}
static std::unique_ptr<uint8_t[]> LoadPixels(const std::string &filename, 
	uint32_t &width, uint32_t &height, uint32_t &components, VkFormat &format);

// Current
class Texture : public NonCopyable, public Descriptor, public Resource{}
Json::Json(Metadata *metadata) : Metadata("", "") { AddChildren(metadata, this); }
static std::unique_ptr<uint8_t[]> LoadPixels(
	const std::string &filename, uint32_t &width, uint32_t &height, uint32_t &components, VkFormat &format);

Some indentation also gets ugly:

		m_pipelineMaterial = PipelineMaterial::Create(
			{1, 0}, PipelineGraphicsCreate({"Shaders/Skyboxes/Skybox.vert", "Shaders/Skyboxes/Skybox.frag"},
						{VertexModel::GetVertexInput()}, {}, PipelineGraphics::Mode::Mrt, PipelineGraphics::Depth::None,
						VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST, VK_POLYGON_MODE_FILL, VK_CULL_MODE_FRONT_BIT));

add two workarounds in #56

For function paremeter case(the third case), it ain't that bad to break lines between paremeters, otherwise it is very possible to violate columlimit