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

Black Formatter #769

Merged
merged 6 commits into from Dec 21, 2019
Merged

Black Formatter #769

merged 6 commits into from Dec 21, 2019

Conversation

MinchinWeb
Copy link
Contributor

This adds the black formatter as Linting stage to the Travis-CI setup. The existing code was also adjusted, as needed, to pass the linter.

This linting stage has to pass before the regular tests are run.

Checklist

  • The code change is tested and works locally.
  • Tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR. (Except for added comments, but then those aren't really code, are they?)
  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?

@wren
Copy link
Member

wren commented Dec 9, 2019

Thanks for the PR. I'll review this on Tuesday (my next jrnl work day).

Small point of order: the contributing guidelines ask that we open a new issue for new features. This gives us a chance to talk about things before you put the work into implementing it. In this case, I do happen to like Black already, but please try to follow the guidelines in the future.

@MinchinWeb
Copy link
Contributor Author

I created issue #770 as a place to have some discussion around this!

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.

Overall looks good. Just need a bit of cleaning up of the travis config.

.travis.yml Outdated Show resolved Hide resolved
.travis.yml Outdated Show resolved Hide resolved
.travis.yml Outdated Show resolved Hide resolved
features/steps/core.py Outdated Show resolved Hide resolved
Remove "Lint" as separate stage; have `black` check the output rather than run the re-formmater
@MinchinWeb MinchinWeb requested a review from wren December 13, 2019 16:16
@wren
Copy link
Member

wren commented Dec 14, 2019

Hey, this is going to be very prone to merge conflicts, and I don't want you to try to hit a moving target. Can you take out the changes made by black itself, and just do the travis file and the fmt comments? I can run black when this gets merged so there are no conflicts.

@wren
Copy link
Member

wren commented Dec 14, 2019

It is otherwise ready for approval, though. Thank you!

# Conflicts:
#	jrnl/EncryptedJournal.py
#	jrnl/Journal.py
#	jrnl/__init__.py
#	jrnl/cli.py
#	jrnl/install.py
@MinchinWeb
Copy link
Contributor Author

@wren I just updated it to the current 'develop' branch. Mostly as a way to get Travis-CI to run (maybe..). It should be a clean merge at the moment.

@MinchinWeb
Copy link
Contributor Author

Black doesn't want to make any changes locally, but want to on Travis, so I added the --diff option to figure out why.



if type(journal_conf) is dict:
# We can override the default config on a by-journal basis
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# We can override the default config on a by-journal basis
# We can override the default config on a by-journal basis

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.

Approving so I can get this merged and fix the issues.

@MinchinWeb The problem, I'm guessing, is that you're running a different version of black than the build is on Travis. Make sure you're using poetry (e.g. poetry run black .) when running locally to ensure the same version.

@wren wren merged commit 2e920a7 into jrnl-org:develop Dec 21, 2019
@MinchinWeb MinchinWeb deleted the black branch December 24, 2019 17:34
@wren wren added the build Issues related to the build pipeline label Jan 10, 2020
@lock
Copy link

lock bot commented May 21, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot added the 🔒 Outdated label May 21, 2020
@lock lock bot locked as resolved and limited conversation to collaborators May 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
build Issues related to the build pipeline 🔒 Outdated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants