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

Allow to preserve keys order in ConsoleRenderer. Related to #166 #358

Merged
merged 5 commits into from
Nov 2, 2021

Conversation

darklow
Copy link
Contributor

@darklow darklow commented Oct 13, 2021

Pull Request Check List

This is just a friendly reminder about the most common mistakes. Please make sure that you tick all boxes. But please read our contribution guide at least once, it will save you unnecessary review cycles!

If an item doesn't apply to your pull request, check it anyway to make it apparent that there's nothing left to do.

  • Added tests for changed code.
  • Updated documentation for changed code.
    • New functions/classes have to be added to docs/api.rst by hand.
    • Changed/added classes/methods/functions have appropriate versionadded, versionchanged, or deprecated directives. Find the appropriate next version in our __init__.py file.
  • Documentation in .rst files is written using semantic newlines.
  • Changes (and possible deprecations) are documented in the changelog.

If you have any questions to any of the points above, just submit and ask! This checklist is here to help you, not to deter you from contributing!

@hynek
Copy link
Owner

hynek commented Oct 21, 2021

In case you're waiting for feedback:

  • the CI is failing
  • we don't need OrderedDict since structlog is 3.6+
  • it needs a .. versionadded
  • it needs a changelog entry

@darklow
Copy link
Contributor Author

darklow commented Oct 21, 2021

Thanks for feedback, if you find this PR useful, I can complete missing parts, wanted to be sure this change is welcomed before spending time the completion and docs.

Btw, seems to me CI is failing for non-related to my changes reasons:
/~https://github.com/hynek/structlog/pull/358/checks?check_run_id=3886960621

{'detail': ErrorDetail(string='Unable to locate build via Github Actions API. Please upload with the Codecov repository upload token to resolve issue.', code='not_found')}
Error: Codecov failed with the following error: The process '/usr/bin/bash' failed with exit code 1

@hynek
Copy link
Owner

hynek commented Oct 23, 2021

I don't see much value in the behavior myself, but the impact is small enough that I'd merge it to make others happy. ;)

I've re-run the tests and now mypy is failing...I tried briefly to recreate the error locally but I couldn't.

@mje-nz
Copy link

mje-nz commented Nov 2, 2021

@darklow For what it's worth, I'm also interested in this feature.

@darklow
Copy link
Contributor Author

darklow commented Nov 2, 2021

I personally see lot of value organising keys by priority, most important at first, and more secondary later rather relying on alphabet. Also having same length parameters as first helps readability as well.

Just pushed three things you mentioned.

@hynek
Copy link
Owner

hynek commented Nov 2, 2021

I personally see lot of value organising keys by priority, most important at first, and more secondary later rather relying on alphabet.

To be clear, I don't disagree. It's just not always clear that the most important keys are merged first and sorting them gives a stable order which is also useful.

Copy link
Owner

@hynek hynek left a comment

Choose a reason for hiding this comment

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

thanks!

@hynek hynek merged commit 86e4e64 into hynek:main Nov 2, 2021
@hynek
Copy link
Owner

hynek commented Nov 2, 2021

(docs were failing due to a typo in the PR number but I quickly fixed it in abc9312 myself to avoid extra review cycles)

@darklow
Copy link
Contributor Author

darklow commented Nov 2, 2021

Thanks for approval and docs fix!

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