[go: up one dir, main page]

Skip to content

BUG? --squeeze-ws removes spaces before comments

Probably a feature request as this may be working as expected! Feel free to edit the title etc

--squeeze-ws was added in 3.3 and it works great but today I saw some collateral effect that made me reevaluate using it:

// Original
std::array<glm::vec3, 2> compute(
    const glm::vec3& aabb_min,                         // Axis-aligned bounding box min corner
    const glm::vec3& aabb_max,                         // Axis-aligned bounding box max corner
    const glm::vec3& surface_normal,                   // Assumed normalized in world space
    const glm::vec3& surface_origin = glm::vec3(0.0f),  // Affects projection reference point
    const glm::mat4& model_matrix = glm::mat4(1.0f)     // Optional transform when AABB is in local space
);

// Newly formatted
std::array<glm::vec3, 2> compute(
    const glm::vec3& aabb_min, // Axis-aligned bounding box min corner
    const glm::vec3& aabb_max, // Axis-aligned bounding box max corner
    const glm::vec3& surface_normal, // Assumed normalized in world space
    const glm::vec3& surface_origin = glm::vec3(0.0f), // Affects projection reference point
    const glm::mat4& model_matrix = glm::mat4(1.0f) // Optional transform when AABB is in local space
);

Not saying that the prev code was how things should be done (e.g. Doxygen) etc, just a random sample.

  • But some pieces of code might auto/manually align comments at certain line position rather than above the lines.
  • Current --squeeze-ws is incompatible with this, so I suggest making it ignore ending spaces before comments.
    • This could be negative to some people, so I guess an alternative/extra flag could be added instead e.g. --keep_unsqueezed-comments
Edited by Diego Mateos