New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bad code alignment with multiple parenthesis #4207
Comments
I maybe have a similar issue related to this with multiple consecutive parentheses/calls. I'm using The syntax for adding/defining options is like this: int main(int argc, char** argv)
{
// ...
cxxopts::Options options{argv[0], "Description"};
options.add_options()
("a,optionA", "Option A Help Description")
("b,optionB", "Option B Help Description")
("c,optionC", "Option C Help Description")
("d,optionD", "Option D Help Description");
// ...
} When using uncrustify it will be formatted like this even though i'd like to have it formatted like above: int main(int argc, char** argv)
{
// ...
cxxopts::Options options{argv[0], "Description"};
options.add_options()
("a,optionA", "Option A Help Description")
("b,optionB", "Option B Help Description")
("c,optionC", "Option C Help Description")
("d,optionD", "Option D Help Description");
// ...
} I didn't find any option for consecutive parentheses and their indentation. Version: Cheers, |
Sorry, I cannot reproduce.
with the command:
I get: I run under Linux. |
When running uncrustify with the snippet from @pemessier i get another different result: int CPtCloudDataSWL::ASCIIReadNbPts(const size_t nbPtsToRead_)
{
const CTUnitDird normal(m_euler.TransformationMatrixGet()(0, 2),
m_euler.TransformationMatrixGet()(1, 2),
m_euler.TransformationMatrixGet()(2, 2));
const size_t nbPtsAdded = m_pts.size() - nbPtsToRead_; // see this additional indentation
m_ptNormals.insert(m_ptNormals.end(), nbPtsAdded, CTDirToF(normal)); // and this one ..
return 1;
} I'm using tabs only and with the parameters you mentioned like the following:
On Linux, version My configuration file: |
Sorry my initial example was bad. This is the expected (no change) output that can be used as input:
The assignment lines are left-indented by 4 spaces. On Windows, running
|
Using
Uncrustify-0.78.1_f
, with the default configuration.Consider the following code:
The last 2 lines before the return is not well aligned. However:
This works as expected. Uncrustify seems to get confused because of the
()( … )
syntax.The text was updated successfully, but these errors were encountered: