Skip to content

Fix mixed indents in block strings - #77

Closed
janedbal wants to merge 17 commits into
nette:masterfrom
janedbal:fix-mixed-indents
Closed

Fix mixed indents in block strings#77
janedbal wants to merge 17 commits into
nette:masterfrom
janedbal:fix-mixed-indents

Conversation

@janedbal

Copy link
Copy Markdown
Contributor
  • bug fix
  • BC break? no

  • When using custom indents (spaces) and block mode, inner part of block strings were always indented with tab.
  • This showed up in our git-based whitespace check in pre-commit (git diff-index --check --cached HEAD -- $FILES) as space before tab in indent error.
  • The real usecase is PHPStan baseline of deprecated usages where newline is very often.

Before:

inner:
    msg: '''
    	string
    	with newline
    '''

After this fix:

inner:
    msg: '''
        string
        with newline
    '''

@janedbal

Copy link
Copy Markdown
Contributor Author

@dg Any chance you find a minute to look at this? Thank you

@dg
dg force-pushed the master branch 2 times, most recently from 30032d8 to 90a0d3f Compare June 18, 2025 19:35
@dg

dg commented Jun 19, 2025

Copy link
Copy Markdown
Member

Wouldn't it be easier to solve it in StringNode using property $indentation as in BlockArrayNode?

@janedbal

Copy link
Copy Markdown
Contributor Author

Wouldn't it be easier to solve it in StringNode using property $indentation as in BlockArrayNode?

Tried in #78, but StringNode is also created in Parser::parseValue where I was not sure how to get the indent properly...

@janedbal

Copy link
Copy Markdown
Contributor Author

@dg Can you give a second look? Thank you.

@dg
dg force-pushed the master branch 2 times, most recently from dbe2c23 to 8285932 Compare November 25, 2025 13:13
@dg dg closed this Nov 25, 2025
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