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

More graceful handling of low linewrap values #1219

Merged
merged 7 commits into from
Apr 10, 2021

Conversation

sriniv27
Copy link
Contributor

This is intended to fix #1201 in the following manner:

  1. Enforce a positive initial linewrap
  2. If the the total linewrap is not big enough to accommodate the date string in its entirety, throw an error explaining so.

I tried another direction where the date string is wrapped as well and the top left corner is extended downwards until all of the date can be chopped up and wrapped. It's pretty tricky to do gracefully so I'm not confident of checking that in yet. You can see the code at the branch if you like.

Checklist

  • I have read the contributing doc.
  • I have included a link to the relevant issue number.
  • I have tested this code locally.
  • I have checked to ensure there aren't other open pull requests
    for the same issue.
  • I have written new tests for these changes, as needed.
  • All tests pass.

Check column widths

update gitignore

throw error when linewrap too small

simply check for large enough linewrap value
@sriniv27 sriniv27 changed the title Pr for 1201 More graceful handling of low linewrap values Mar 24, 2021
@wren
Copy link
Member

wren commented Mar 27, 2021

Hi! Thanks for this. We were looking at this today, and it's looking good, but I want to do some more testing on it before doing a proper review.

Copy link
Member

@micahellison micahellison left a comment

Choose a reason for hiding this comment

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

Thanks for submitting this. Just have a few changes/clarifications.

.gitignore Outdated Show resolved Hide resolved
jrnl/exception.py Outdated Show resolved Hide resolved
jrnl/plugins/fancy_exporter.py Outdated Show resolved Hide resolved
jrnl/plugins/fancy_exporter.py Show resolved Hide resolved
make exception more informative

update check_linewrap signature in src and test

make check_linewrap a free function
tests/test_export.py Outdated Show resolved Hide resolved
Copy link
Member

@wren wren left a comment

Choose a reason for hiding this comment

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

Looks great. Thank you!

Copy link
Member

@micahellison micahellison left a comment

Choose a reason for hiding this comment

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

Thanks for your work on this. Looks great. 💯

@micahellison micahellison added the bug Something isn't working label Apr 10, 2021
@micahellison micahellison merged commit dd74b14 into jrnl-org:develop Apr 10, 2021
sriniv27 added a commit to sriniv27/jrnl that referenced this pull request May 6, 2021
FIrst pass at allow external plugins

remove template exporter

Add listing of active plugins to '--version' output

Documentation for plugins

[Docs] add custom imports and exporters to site TOC

[Docs] better linewrapping

Include dates_exporter

Use Base classes for importer and exporters.

[Docs] improve documentation of custom Importers and Exporters

[Testing] separate run with external plugin!

Bump keyring from 22.3.0 to 23.0.0 (jrnl-org#1213)

Bumps [keyring](https://github.com/jaraco/keyring) from 22.3.0 to 23.0.0.
- [Release notes](https://github.com/jaraco/keyring/releases)
- [Changelog](https://github.com/jaraco/keyring/blob/main/CHANGES.rst)
- [Commits](jaraco/keyring@v22.3.0...v23.0.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Increment version to v2.8-beta

Changelog generator fixes

There were several problems that this fixes:
- shallow fetch broke merging to release branch
- bad changelog was only outputting error msg (not exiting)
- latest version being on first line deleted itself and broke the
  changelog updates

This also has manual fixes to the changelog to bring it up to date.

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>

Bump pyflakes from 2.2.0 to 2.3.0 (jrnl-org#1215)

Bumps [pyflakes](https://github.com/PyCQA/pyflakes) from 2.2.0 to 2.3.0.
- [Release notes](https://github.com/PyCQA/pyflakes/releases)
- [Changelog](https://github.com/PyCQA/pyflakes/blob/master/NEWS.rst)
- [Commits](PyCQA/pyflakes@2.2.0...2.3.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Change PR steps for brew release

The hub cli tool wasn't working anymore, so we took it out.

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>

Update changelog [ci skip]

Increment version to v2.8

Update changelog [ci skip]

Update brew tap for release pipeline

This was left out of a previous commit.

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>

Docs: Add emacs as external editor to recipes (jrnl-org#1220)

Add emacs as external editor to recipes

Bump cryptography from 3.4.6 to 3.4.7 (jrnl-org#1223)

Bumps [cryptography](https://github.com/pyca/cryptography) from 3.4.6 to 3.4.7.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](pyca/cryptography@3.4.6...3.4.7)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Update changelog [ci skip]

Bump pyflakes from 2.3.0 to 2.3.1 (jrnl-org#1221)

Bumps [pyflakes](https://github.com/PyCQA/pyflakes) from 2.3.0 to 2.3.1.
- [Release notes](https://github.com/PyCQA/pyflakes/releases)
- [Changelog](https://github.com/PyCQA/pyflakes/blob/master/NEWS.rst)
- [Commits](PyCQA/pyflakes@2.3.0...2.3.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Bump keyring from 23.0.0 to 23.0.1 (jrnl-org#1222)

Bumps [keyring](https://github.com/jaraco/keyring) from 23.0.0 to 23.0.1.
- [Release notes](https://github.com/jaraco/keyring/releases)
- [Changelog](https://github.com/jaraco/keyring/blob/main/CHANGES.rst)
- [Commits](jaraco/keyring@v23.0.0...v23.0.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Bump pytest from 6.2.2 to 6.2.3 (jrnl-org#1228)

Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.2.2 to 6.2.3.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](pytest-dev/pytest@6.2.2...6.2.3)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Update changelog [ci skip]

Update changelog [ci skip]

More graceful handling of low linewrap values  (jrnl-org#1219)

* behavior outline

* enforce positive initial linewrap

Check column widths

update gitignore

throw error when linewrap too small

simply check for large enough linewrap value

* delete unused error message

* PR feedback

make exception more informative

update check_linewrap signature in src and test

make check_linewrap a free function

* delete unused function

* delete else..pass block

* newline for make format

Update changelog [ci skip]

merge from upstream

Add pypi links for documentation, issue tracking, and funding (jrnl-org#1204)

Update changelog [ci skip]

Fix bug that prevented --format pretty and --format short from working (jrnl-org#1177)

Update changelog [ci skip]

Fix broken brew release process (jrnl-org#1211)

* Add homebrew symlink for releases
* Fix indentation problem
* Fix bad env var name
* Change filename to formula name
* Fix formula name
* Attempt tap instead of symlink
* Fix formula repo referece
* add tracer
* Attempt working directory fix
* Remove --unshallow
* Use token for remote
* Move set tap directory step
* Remove tracer
* Clean up spacing and wrap quotes to tap directory

Remove global flag from git config

Add --local flag in git config calls

Increment version to v2.7.2-beta

Bump keyring from 22.3.0 to 23.0.0 (jrnl-org#1213)

Bumps [keyring](https://github.com/jaraco/keyring) from 22.3.0 to 23.0.0.
- [Release notes](https://github.com/jaraco/keyring/releases)
- [Changelog](https://github.com/jaraco/keyring/blob/main/CHANGES.rst)
- [Commits](jaraco/keyring@v22.3.0...v23.0.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Increment version to v2.8-beta

Changelog generator fixes

There were several problems that this fixes:
- shallow fetch broke merging to release branch
- bad changelog was only outputting error msg (not exiting)
- latest version being on first line deleted itself and broke the
  changelog updates

This also has manual fixes to the changelog to bring it up to date.

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>

Bump pyflakes from 2.2.0 to 2.3.0 (jrnl-org#1215)

Bumps [pyflakes](https://github.com/PyCQA/pyflakes) from 2.2.0 to 2.3.0.
- [Release notes](https://github.com/PyCQA/pyflakes/releases)
- [Changelog](https://github.com/PyCQA/pyflakes/blob/master/NEWS.rst)
- [Commits](PyCQA/pyflakes@2.2.0...2.3.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Change PR steps for brew release

The hub cli tool wasn't working anymore, so we took it out.

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>

Update changelog [ci skip]

Bump cryptography from 3.4.6 to 3.4.7 (#28)

Bumps [cryptography](https://github.com/pyca/cryptography) from 3.4.6 to 3.4.7.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](pyca/cryptography@3.4.6...3.4.7)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Bump keyring from 22.3.0 to 23.0.1 (#27)

Bumps [keyring](https://github.com/jaraco/keyring) from 22.3.0 to 23.0.1.
- [Release notes](https://github.com/jaraco/keyring/releases)
- [Changelog](https://github.com/jaraco/keyring/blob/main/CHANGES.rst)
- [Commits](jaraco/keyring@v22.3.0...v23.0.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Bump pyflakes from 2.2.0 to 2.3.1 (#26)

Bumps [pyflakes](https://github.com/PyCQA/pyflakes) from 2.2.0 to 2.3.1.
- [Release notes](https://github.com/PyCQA/pyflakes/releases)
- [Changelog](https://github.com/PyCQA/pyflakes/blob/master/NEWS.rst)
- [Commits](PyCQA/pyflakes@2.2.0...2.3.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
sriniv27 added a commit to sriniv27/jrnl that referenced this pull request May 6, 2021
FIrst pass at allow external plugins

remove template exporter

Add listing of active plugins to '--version' output

Documentation for plugins

[Docs] add custom imports and exporters to site TOC

[Docs] better linewrapping

Include dates_exporter

Use Base classes for importer and exporters.

[Docs] improve documentation of custom Importers and Exporters

[Testing] separate run with external plugin!

Bump keyring from 22.3.0 to 23.0.0 (jrnl-org#1213)

Bumps [keyring](https://github.com/jaraco/keyring) from 22.3.0 to 23.0.0.
- [Release notes](https://github.com/jaraco/keyring/releases)
- [Changelog](https://github.com/jaraco/keyring/blob/main/CHANGES.rst)
- [Commits](jaraco/keyring@v22.3.0...v23.0.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Increment version to v2.8-beta

Changelog generator fixes

There were several problems that this fixes:
- shallow fetch broke merging to release branch
- bad changelog was only outputting error msg (not exiting)
- latest version being on first line deleted itself and broke the
  changelog updates

This also has manual fixes to the changelog to bring it up to date.

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>

Bump pyflakes from 2.2.0 to 2.3.0 (jrnl-org#1215)

Bumps [pyflakes](https://github.com/PyCQA/pyflakes) from 2.2.0 to 2.3.0.
- [Release notes](https://github.com/PyCQA/pyflakes/releases)
- [Changelog](https://github.com/PyCQA/pyflakes/blob/master/NEWS.rst)
- [Commits](PyCQA/pyflakes@2.2.0...2.3.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Change PR steps for brew release

The hub cli tool wasn't working anymore, so we took it out.

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>

Update changelog [ci skip]

Increment version to v2.8

Update changelog [ci skip]

Update brew tap for release pipeline

This was left out of a previous commit.

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>

Docs: Add emacs as external editor to recipes (jrnl-org#1220)

Add emacs as external editor to recipes

Bump cryptography from 3.4.6 to 3.4.7 (jrnl-org#1223)

Bumps [cryptography](https://github.com/pyca/cryptography) from 3.4.6 to 3.4.7.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](pyca/cryptography@3.4.6...3.4.7)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Update changelog [ci skip]

Bump pyflakes from 2.3.0 to 2.3.1 (jrnl-org#1221)

Bumps [pyflakes](https://github.com/PyCQA/pyflakes) from 2.3.0 to 2.3.1.
- [Release notes](https://github.com/PyCQA/pyflakes/releases)
- [Changelog](https://github.com/PyCQA/pyflakes/blob/master/NEWS.rst)
- [Commits](PyCQA/pyflakes@2.3.0...2.3.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Bump keyring from 23.0.0 to 23.0.1 (jrnl-org#1222)

Bumps [keyring](https://github.com/jaraco/keyring) from 23.0.0 to 23.0.1.
- [Release notes](https://github.com/jaraco/keyring/releases)
- [Changelog](https://github.com/jaraco/keyring/blob/main/CHANGES.rst)
- [Commits](jaraco/keyring@v23.0.0...v23.0.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Bump pytest from 6.2.2 to 6.2.3 (jrnl-org#1228)

Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.2.2 to 6.2.3.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](pytest-dev/pytest@6.2.2...6.2.3)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Update changelog [ci skip]

Update changelog [ci skip]

More graceful handling of low linewrap values  (jrnl-org#1219)

* behavior outline

* enforce positive initial linewrap

Check column widths

update gitignore

throw error when linewrap too small

simply check for large enough linewrap value

* delete unused error message

* PR feedback

make exception more informative

update check_linewrap signature in src and test

make check_linewrap a free function

* delete unused function

* delete else..pass block

* newline for make format

Update changelog [ci skip]

merge from upstream

Add pypi links for documentation, issue tracking, and funding (jrnl-org#1204)

Update changelog [ci skip]

Fix bug that prevented --format pretty and --format short from working (jrnl-org#1177)

Update changelog [ci skip]

Fix broken brew release process (jrnl-org#1211)

* Add homebrew symlink for releases
* Fix indentation problem
* Fix bad env var name
* Change filename to formula name
* Fix formula name
* Attempt tap instead of symlink
* Fix formula repo referece
* add tracer
* Attempt working directory fix
* Remove --unshallow
* Use token for remote
* Move set tap directory step
* Remove tracer
* Clean up spacing and wrap quotes to tap directory

Remove global flag from git config

Add --local flag in git config calls

Increment version to v2.7.2-beta

Bump keyring from 22.3.0 to 23.0.0 (jrnl-org#1213)

Bumps [keyring](https://github.com/jaraco/keyring) from 22.3.0 to 23.0.0.
- [Release notes](https://github.com/jaraco/keyring/releases)
- [Changelog](https://github.com/jaraco/keyring/blob/main/CHANGES.rst)
- [Commits](jaraco/keyring@v22.3.0...v23.0.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Increment version to v2.8-beta

Changelog generator fixes

There were several problems that this fixes:
- shallow fetch broke merging to release branch
- bad changelog was only outputting error msg (not exiting)
- latest version being on first line deleted itself and broke the
  changelog updates

This also has manual fixes to the changelog to bring it up to date.

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>

Bump pyflakes from 2.2.0 to 2.3.0 (jrnl-org#1215)

Bumps [pyflakes](https://github.com/PyCQA/pyflakes) from 2.2.0 to 2.3.0.
- [Release notes](https://github.com/PyCQA/pyflakes/releases)
- [Changelog](https://github.com/PyCQA/pyflakes/blob/master/NEWS.rst)
- [Commits](PyCQA/pyflakes@2.2.0...2.3.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Change PR steps for brew release

The hub cli tool wasn't working anymore, so we took it out.

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>

Update changelog [ci skip]

Bump cryptography from 3.4.6 to 3.4.7 (#28)

Bumps [cryptography](https://github.com/pyca/cryptography) from 3.4.6 to 3.4.7.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](pyca/cryptography@3.4.6...3.4.7)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Bump keyring from 22.3.0 to 23.0.1 (#27)

Bumps [keyring](https://github.com/jaraco/keyring) from 22.3.0 to 23.0.1.
- [Release notes](https://github.com/jaraco/keyring/releases)
- [Changelog](https://github.com/jaraco/keyring/blob/main/CHANGES.rst)
- [Commits](jaraco/keyring@v22.3.0...v23.0.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Bump pyflakes from 2.2.0 to 2.3.1 (#26)

Bumps [pyflakes](https://github.com/PyCQA/pyflakes) from 2.2.0 to 2.3.1.
- [Release notes](https://github.com/PyCQA/pyflakes/releases)
- [Changelog](https://github.com/PyCQA/pyflakes/blob/master/NEWS.rst)
- [Commits](PyCQA/pyflakes@2.2.0...2.3.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@MinchinWeb MinchinWeb mentioned this pull request May 8, 2021
4 tasks
MinchinWeb added a commit to MinchinWeb/jrnl that referenced this pull request May 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fancy format crashes on low linewrap values
3 participants