Skip to content

Feature/code indentation#1007

Merged
Ducasse merged 4 commits intopillar-markup:devfrom
Fanirindrainy:feature/code-indentation
Mar 22, 2026
Merged

Feature/code indentation#1007
Ducasse merged 4 commits intopillar-markup:devfrom
Fanirindrainy:feature/code-indentation

Conversation

@Fanirindrainy
Copy link
Contributor

No description provided.

#category : 'Microdown-Rules-CodeIndetation',
#package : 'Microdown-Rules',
#tag : 'CodeIndetation'
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add a class comment that explains what this checker is about?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I'll add class comment for this checker.

"verify if the line begin with space"
(line first = Character space) ifTrue: [
"except the space in the code like nextPut: ' '"
(line trimLeft includesSubstring: 'nextPut: '' ''') ifFalse: [
Copy link
Contributor

Choose a reason for hiding this comment

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

I do not understand why there is a check with nextPut:

I would imagine that we could look for Character space.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are absolutely right, the correct rule is simply to check wheter the line starts with a space; the content of the line should not matter. I'll correct this.

| file |
"incorrect cases - space instead of tabs"
file := fileSystem workingDirectory / 'indentationWrong.md'.
file writeStreamDo: [ :steam |
Copy link
Contributor

Choose a reason for hiding this comment

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

steam -> stream

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, my bad, I'll correct this.

@Ducasse
Copy link
Contributor

Ducasse commented Mar 22, 2026

I will merge it and we will be able to check on real books once this is integrated into Pillar.
It will be a great validation

@Ducasse Ducasse merged commit 7be6f1e into pillar-markup:dev Mar 22, 2026
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