Skip to content

Conversation

@jvsqzj
Copy link
Contributor

@jvsqzj jvsqzj commented May 30, 2025

This PR introduces Line Length and Breaking style rules to the lint module. It also covers rule IN6 which was left out of scope for previous Indentation rules patch and had important implications for line length implementation.

@jvsqzj jvsqzj changed the title Add exception to indent_paren_expr to be handled by LL6 rule Implement line length and breaking rules May 30, 2025
@jvsqzj jvsqzj force-pushed the feature/73-line-breaking branch from a36462e to d9bb070 Compare June 19, 2025 15:31
@jvsqzj jvsqzj force-pushed the feature/73-line-breaking branch from d9bb070 to 3110e82 Compare June 23, 2025 16:48
@me-cr me-cr force-pushed the feature/73-line-breaking branch 7 times, most recently from b934564 to cca1d93 Compare July 1, 2025 16:29
@me-cr me-cr force-pushed the feature/73-line-breaking branch 2 times, most recently from ed9dae7 to faf5b2a Compare July 3, 2025 22:17
@jvsqzj jvsqzj mentioned this pull request Oct 3, 2025
@jvsqzj jvsqzj force-pushed the feature/73-line-breaking branch 3 times, most recently from 308ee69 to 18a10ea Compare October 3, 2025 22:47
@jvsqzj jvsqzj marked this pull request as ready for review October 3, 2025 22:48
jvsqzj and others added 5 commits October 3, 2025 15:49
@jvsqzj jvsqzj force-pushed the feature/73-line-breaking branch from 18a10ea to d9825d1 Compare October 3, 2025 22:50
Copy link
Contributor

@JonatanWaern JonatanWaern left a comment

Choose a reason for hiding this comment

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

Will examine further next week, but looks good so far

```
x = (a_very_long_expression
+ another_very_long_expression)
* a_third_long_expression;
Copy link
Contributor

Choose a reason for hiding this comment

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

indentation error in example?

# Change Log

## 0.9.14
- Added support for line length and breaking rules break_func_call_open_paren, break_method_output, break_conditional_expression and break_before_binary_op.
Copy link
Contributor

Choose a reason for hiding this comment

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

Should probably primarily focus on user-friendly version of description of what linting has improved (this is allowed to be vague, or just a reference to the rule number in-doc), followed by the identifier of the linting rules (this is still valuable feedback, as these now also appear in linting messages)

structure::{MethodContent, ObjectStatementsContent},
tree::TreeElementTokenIterator,
types::{BitfieldsContent, LayoutContent, StructTypeContent}};
use crate::analysis::parsing::{expression::{CastContent, FunctionCallContent, ParenExpressionContent}, lexer::TokenKind, parser::Token, statement::{self, CompoundContent, DoContent, ForContent, ForeachContent, IfContent, StatementContent, SwitchCase, SwitchContent, WhileContent}, structure::{DMLObjectContent, MethodContent, ObjectStatementsContent}, tree::TreeElementTokenIterator, types::{BitfieldsContent, LayoutContent, StructTypeContent}};
Copy link
Contributor

Choose a reason for hiding this comment

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

This change to the import indentation is a downgrade, and I am not sure what prompted it? IMO I think using multiple branches of sub-modules in an import a little awkward (so I'd prefer multiple lines all starting with "crate::analysis::parsing::") , but I'd accept this as it was pre-change.

Copy link
Contributor

@JonatanWaern JonatanWaern left a comment

Choose a reason for hiding this comment

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

I think the changelog merge conflict blocks the ability to run a CI on this (which is weird), but likely you need to run clippy on this also

let mut tokens = node.tokens();
Self::filter_out_last_semi_ranges(&mut tokens);
return Some(IndentContinuationLineArgs {
token_list: IndentParenExprArgs::filter_out_parenthesized_tokens(tokens),
Copy link
Contributor

Choose a reason for hiding this comment

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

slight indentation error

|| ! IndentParenExprArgs::is_broken_after_lparen(
node.lparen.range(),
filtered_member_ranges.first()?.to_owned()) {
return None
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing semicolon in return statement

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.

5 participants