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

Code refactor #689

Merged
merged 7 commits into from
May 11, 2023
Merged

Code refactor #689

merged 7 commits into from
May 11, 2023

Conversation

laraconda
Copy link
Contributor

Summary of the changes in this pull request

It was not possible to start the program via python3 rednotebook/journal.py. Now it is possible after reverting the file jorunal.py (as suggested here: https://github.com/jendrikseipp/rednotebook/pull/663/files#r1064037003)

Pull request checklist

  • I have added an entry in CHANGELOG.md including my name and issue and/or pull request number.
  • If applicable: I have removed the corresponding entry in TODO.md.

HighnessAtharva and others added 5 commits January 5, 2023 20:29
I scanned the entire codebase for potential issues regarding performance and readability and fixed as many issues as possible.  This should make the codebase "modern" and more cleaner to read/review through.

These fixes include:
- Better named expressions added
- f-strings added rather than interpolated variable names better conditional branching added (which is a good practice and follows standards laid out by the Python community)
- code made more readable following "pythonic" code style
- improved formatting based on PEP8 guidelines
- added list comprehensions wherever needed replacing large, complex-looking code blocks
- `TODO.md`  formatted based on Markdown file guidelines.
@jendrikseipp
Copy link
Owner

I started the CI tests now. Ping me once this is ready for review.

@laraconda
Copy link
Contributor Author

Its ready. The only problem is the style checker finds a problem: rednotebook/gui/clouds.py:149:111: E501 line too long (117 > 110 characters)
That line corresponds to the html code in the cloud maker.
I suppose the best way to handle this is to tell the checker to ignore it. Is there a way to do it?

'<a href="/#search-%s">'
'<span style="font-size:%spx">%s</span></a>&#160;'
% (self.link_index, font_size, word)
f'<a href="/#search-{self.link_index}"><span style="font-size:{font_size}px">{word}</span></a>&#160;'
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
f'<a href="/#search-{self.link_index}"><span style="font-size:{font_size}px">{word}</span></a>&#160;'
f'<a href="/#search-{self.link_index}"><span '
f'style="font-size:{font_size}px">{word}</span></a>&#160;'

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, that's a nice way to break it.

@jendrikseipp
Copy link
Owner

Best to break the line, I think.

@laraconda
Copy link
Contributor Author

I amended the previous commit to add the line break.

@laraconda
Copy link
Contributor Author

@jendrikseipp I think you missed the previous message.
Is there anything else you would want me to fix/ re-visit?

@jendrikseipp jendrikseipp merged commit accaa0e into jendrikseipp:master May 11, 2023
@jendrikseipp
Copy link
Owner

Thanks @HighnessAtharva and @laraconda for your work on this! Nice to see the code improve in so many places!

@laraconda laraconda deleted the code-refactor branch May 13, 2023 22:25
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.

3 participants