Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplifies TextAttributes #35

Merged
merged 8 commits into from
Jul 25, 2019
Merged

Simplifies TextAttributes #35

merged 8 commits into from
Jul 25, 2019

Conversation

felix-gohla
Copy link
Contributor

Fixes #18.

One comment: In the tests we e.g. check against MarkdownAttribute bold textAttribute. Should we change that to TextEmphasis bold?

Co-authored-by: Kira Grammel kira.grammel@student.hpi.de

- deletes MarkdownTextAttributeBold, MarkdownTextAttributeItalic
- adds convenience initializer bold and italic
- MarkdownTextAttribute only has one squeak text attribute


Co-authored-by: Kira Grammel <kira.grammel@student.hpi.de>
@felix-gohla felix-gohla added the Refactor Code improvements label Jul 10, 2019
Copy link
Contributor

@pixunil pixunil left a comment

Choose a reason for hiding this comment

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

Some ideas come late, but I hope not too late ^^'

Copy link
Contributor

@lpfennigschmidt lpfennigschmidt left a comment

Choose a reason for hiding this comment

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

Like it, but I also agree with the others about renaming to MarkdownEmphasis and adding a utility method for testing :D

felix-gohla and others added 4 commits July 23, 2019 11:05
Co-authored-by: Kira Grammel <kira.grammel@student.hpi.de>
- Emphases comparing Utilitymethod
- MarkdownEmphasis bold and italic is now strongFrom: to: and from: to:
- removed some code smell


Co-authored-by: Felix Gohla <felix.gohla@student.hpi.de>
…l :o

Co-authored-by: Kira Grammel <kira.grammel@student.hpi.de>
@felix-gohla felix-gohla requested a review from pixunil July 23, 2019 13:15
Copy link
Contributor

@pixunil pixunil left a comment

Choose a reason for hiding this comment

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

Now I don't fear those inline tests anymore ^^
Shouldn't attributes now become emphases?
Regarding the assert:areEmphasesIn:, I find it strange to supply hash. Supplying = is not ideal, but is relatively trivial, whereas hash looks really like having testing logic where it does not belong

ifFound: [:foundOpener |
self deny: (openCloser = foundOpener).
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this deny redundant? We know that opener and openCloser are two variables, and when we assert that the foundOpener is opener, it can't be openCloser by transitivity, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We just left it in. In my point of view, this "redundancy" makes the test easier to understand. From a logical standpoint, you're absolutely right. But pointing out, that it is not the openCloser but the opener adds some clarity.

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay, in my case it was the opposite, because I have both of a positive and a negative assert and we actually want to test equality. As a reader, I need to decide whether the deny or the assert is the important part. Thus, it doesn't make it clearer for me, but confuses me...

Copy link
Contributor

@jonaskordt jonaskordt left a comment

Choose a reason for hiding this comment

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

I agree with Jakob mostly.

The main problem I see is having the MarkdownEmphasis>>= and MarkdownEmphasis>>hash in production code, where it doesn't belong.

The rest is fine with me.

felix-gohla and others added 2 commits July 24, 2019 10:00
- The emphasis comparison (>>= and >>hash) is now part of the *MarkdownEditor-Tests package and therefore it will only be distributed when installing the test package.



Co-authored-by: Kira Grammel <kira.grammel@student.hpi.de>
Copy link
Contributor

@pixunil pixunil left a comment

Choose a reason for hiding this comment

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

Do as much as you want to do of the open issues, but I think the core idea of this refactoring is implemented :D

Note: While it may not be the most ideal convention, we try to use
ItalicEmphasis and StrongEmphasis in the tests to differentiate between
"normal" *emphasis* and **strong emphasis**


Co-authored-by: Kira Grammel <kira.grammel@student.hpi.de>
@felix-gohla felix-gohla merged commit dd20ec7 into master Jul 25, 2019
@pixunil pixunil deleted the refactor/attributes branch July 25, 2019 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Refactor Code improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Simplify attributes
5 participants