-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
questionFurther information is requestedFurther information is requested
Description
Problem
(CodeQL CLI 2.17.6)
When you run codeql query format
, respectively the "Format Document" action in the VS Code extension, CodeQL set literal elements are laid out to be as compact as possible.
This is an issue when in the original code the elements were intentionally on separate lines to increase readability.
For example, formatting this code:
import java
from Method m, string s
where
s = m.getDeclaringType().getQualifiedName() + "#" + m.getName() and
s =
[
"com.example.mypackage.subpackage.MyClass#myMethod",
"com.example.otherpackage.MyClass#myMethod",
"com.example.MyClass#myMethod",
"com.example.anotherpackage.AnotherClass#withSomeMethod",
]
select m
will move "com.example.MyClass#myMethod"
on the same line as the previous element:
s =
[
"com.example.mypackage.subpackage.MyClass#myMethod",
- "com.example.otherpackage.MyClass#myMethod",
- "com.example.MyClass#myMethod",
+ "com.example.otherpackage.MyClass#myMethod", "com.example.MyClass#myMethod",
"com.example.anotherpackage.AnotherClass#withSomeMethod",
Suggested solution
If in the original code every set literal element was on a separate line (and maybe the set literal has at least X elements), then the formatted set literal should also have all elements on separate lines.
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested