.clang_format inconsistencies
mattparks opened this issue · 1 comments
mattparks commented
Clang Format currently has three formatting issues:
- Inheritance will wrap into the class line.
AllowShortFunctionsOnASingleLine
will shorten constructors and some methods but not others.- 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));
FirstLoveLife commented
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