Skip to content

Conversation

@spmallette
Copy link
Contributor

Improved gremlint with better argument formatting and added Gremlin formatting via gremlint as a feature to gremlin-mcp.

VOTE +1

If the initial argument to a step exceeded max line length, gremlint would immediately line break and indent. It never looked like well formatted Gremlin in those cases. Changed it so that the initial argument would stay on same line and then align remaining parts to that column where the argument started.

Added greedy argument packing
.count(local)
.is(gt(1)))`);
.filter(select(values)
.count(local)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this needs to be changed but to me this looks very odd. In Java code, when you break a chain of methods for something like fluent APIs into separate lines, there would usually be extra indentation to show which part the next line is supposed to be connected to. Having the starting . line up exactly with the step before it just looks a bit odd. Again, just pointing this out in case anyone else feels the same but I probably wouldn't change it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't like the whole dots starting a line at all in any event - almost wanted to remove the feature and get rid of the complexity. i guess there could be special rules in this case to further indent, but i'm not sure what this should be for Gremlin exactly.. 🤷

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it might be good to have another test to show what should be done in this case rather than it just not crashing. This change can push the indentation of the new line further right, which means Traversals with more nesting will now have a higher chance of hitting the maxLineLength.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm...not sure what to actually write for a test. not really even sure what maxLineLength even means when it's smaller than the longest individual token. i guess that could all be explored, but i'm not sure i want to encode anything with tests right now for that.

there's a lot of open issues on gremlint - i think this is just another one: https://issues.apache.org/jira/browse/TINKERPOP-3224

@kenhuuu
Copy link
Contributor

kenhuuu commented Jan 7, 2026

VOTE +1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants