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

extract linewriter into a context manager #1696

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

graingert
Copy link
Member

@graingert graingert commented Oct 7, 2022

#1695 is needed for the multiline cmgr expression here:

        cmgr: (
            contextlib.AbstractContextManager[_DryRunWriter]
            | contextlib.AbstractContextManager[_LineWriter]
        ) = (
            contextlib.nullcontext(_DryRunWriter())
            if self.dry_run
            else _LineWriter.create(buffer=self.dst_file, newline=self.linesep)
        )
Contributor checklist
  • Provided the tests for the changes.
  • Assure PR title is short, clear, and good to be included in the user-oriented changelog
Maintainer checklist
  • Assure one of these labels is present: backwards incompatible, feature, enhancement, deprecation, bug, dependency, docs or skip-changelog as they determine changelog listing.
  • Assign the PR to an existing or new milestone for the target version (following Semantic Versioning).

@graingert graingert added the skip-changelog Avoid listing in changelog label Oct 7, 2022
@graingert
Copy link
Member Author

the actual change for this PR is here 55bcc80 (#1696)

@graingert
Copy link
Member Author

closing in favour of #1698

@graingert graingert closed this Oct 7, 2022
@graingert graingert deleted the extract-linewriter-into-a-context-manager branch October 7, 2022 13:44
@graingert graingert restored the extract-linewriter-into-a-context-manager branch November 9, 2022 10:20
@graingert graingert reopened this Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-changelog Avoid listing in changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant