diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 98329ea90..a52c8d02f 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -36,7 +36,7 @@ If applicable, add copy/paste the output or attach a screenshots to help explain - OS: [e.g. Windows / macos / Linux distribution & version] - Python version [e.g. 3.10.0] - Git version [e.g. 2.33.1] - - Darker version [e.g. 1.4.1] + - Darker version [e.g. 1.4.2] - Black version [e.g. 22.1.0] - other reformatter and linter versions [e.g. `isort==5.10.0`, `mypy==0.931` diff --git a/.github/workflows/test-bump-version.yml b/.github/workflows/test-bump-version.yml index a20b2b725..d9cc04522 100644 --- a/.github/workflows/test-bump-version.yml +++ b/.github/workflows/test-bump-version.yml @@ -20,4 +20,4 @@ jobs: # reviewing pull requests in `README.rst`. run: | pip install click packaging requests - python release_tools/bump_version.py --dry-run + python release_tools/bump_version.py --minor --dry-run diff --git a/CHANGES.rst b/CHANGES.rst index f0a0b0619..07db0d8f5 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -3,6 +3,16 @@ Unreleased_ These features will be included in the next release: +Added +----- + +Fixed +----- + + +1.4.2_ - 2022-03-12 +=================== + Added ----- - Document ``isort``'s requirement to be run in the same environment as @@ -292,7 +302,8 @@ Added ----- - Initial implementation -.. _Unreleased: https://github.com/akaihola/darker/compare/1.4.1...HEAD +.. _Unreleased: https://github.com/akaihola/darker/compare/1.4.2...HEAD +.. _1.4.2: https://github.com/akaihola/darker/compare/1.4.1...1.4.2 .. _1.4.1: https://github.com/akaihola/darker/compare/1.4.0...1.4.1 .. _1.4.0: https://github.com/akaihola/darker/compare/1.3.2...1.4.0 .. _1.3.2: https://github.com/akaihola/darker/compare/1.3.1...1.3.2 diff --git a/README.rst b/README.rst index 137ff4f83..fd6e89723 100644 --- a/README.rst +++ b/README.rst @@ -22,9 +22,9 @@ .. |changelog-badge| image:: https://img.shields.io/badge/-change%20log-purple :alt: Change log .. _changelog-badge: https://github.com/akaihola/darker/blob/master/CHANGES.rst -.. |next-milestone| image:: https://img.shields.io/github/milestones/progress/akaihola/darker/14?color=red&label=release%201.4.2 +.. |next-milestone| image:: https://img.shields.io/github/milestones/progress/akaihola/darker/13?color=red&label=release%201.5.0 :alt: Next milestone -.. _next-milestone: https://github.com/akaihola/darker/milestone/14 +.. _next-milestone: https://github.com/akaihola/darker/milestone/13 What? @@ -505,7 +505,7 @@ do the following: 1. Append to the created ``.pre-commit-config.yaml`` the following lines:: - repo: https://github.com/akaihola/darker - rev: 1.4.1 + rev: 1.4.2 hooks: - id: darker @@ -524,7 +524,7 @@ You can provide arguments, such as enabling isort, by specifying ``args``. Note the inclusion of the isort Python package under ``additional_dependencies``:: - repo: https://github.com/akaihola/darker - rev: 1.4.1 + rev: 1.4.2 hooks: - id: darker args: [--isort] @@ -564,12 +564,12 @@ Create a file named ``.github/workflows/darker.yml`` inside your repository with - uses: actions/checkout@v2 with: fetch-depth: 0 - - uses: akaihola/darker@1.4.1 + - uses: akaihola/darker@1.4.2 with: options: "--check --diff" revision: "master..." src: "./src" - version: "1.4.1" + version: "1.4.2" ``"uses:"`` specifies which Darker release to get the GitHub Action definition from. We recommend to pin this to a specific release. diff --git a/action.yml b/action.yml index 9765f64f8..618c3a251 100644 --- a/action.yml +++ b/action.yml @@ -14,9 +14,9 @@ inputs: required: false default: "." version: - description: 'Python Version specifier (PEP440) - e.g. "1.4.1"' + description: 'Python Version specifier (PEP440) - e.g. "1.4.2"' required: false - default: "1.4.1" + default: "1.4.2" revision: description: >- Git revision range to compare when determining modified lines. @@ -30,7 +30,7 @@ runs: steps: - name: Commit Range id: commit-range - uses: akaihola/darker/.github/actions/commit-range@1.4.1 + uses: akaihola/darker/.github/actions/commit-range@1.4.2 - name: Run Darker run: | # Exists since using github.action_path + path to main script doesn't diff --git a/release_tools/bump_version.py b/release_tools/bump_version.py index 8143a79e9..f0681c770 100644 --- a/release_tools/bump_version.py +++ b/release_tools/bump_version.py @@ -75,16 +75,16 @@ r"^ rev: {old_version->new_version}", r"^ - uses: akaihola/darker@{old_version->new_version}", r'^ version: "{old_version->new_version}"', - r"label=release%20{new_version->next_version}", + r"label=release%20{any_version->next_version}", ( r"^\.\. \|next-milestone\| image::" r" https://img\.shields\.io/github/milestones/progress/akaihola/darker/" - r"{new_milestone->next_milestone}" + r"{any_milestone->next_milestone}" ), ( r"^\.\. _next-milestone:" r" https://github\.com/akaihola/darker/milestone/" - r"{new_milestone->next_milestone}" + r"{any_milestone->next_milestone}" ), }, ".github/ISSUE_TEMPLATE/bug_report.md": { @@ -106,7 +106,7 @@ def bump_version(dry_run: bool, increment_major: bool, increment_minor: bool) -> path = Path(path_str) content = path.read_text(encoding="utf-8") for pattern_template in pattern_templates: - # example: pattern_template == r"darker/{new_milestone->next_milestone}" + # example: pattern_template == r"darker/{any_milestone->next_milestone}" template_match = CAPTURE_RE.search(pattern_template) if not template_match: raise NoMatch("Can't find `{CAPTURE_RE}` in `{pattern_template}`") @@ -133,16 +133,18 @@ class PatternDict(TypedDict): Example: >>> patterns: PatternDict = { + ... "any_version": r"\d+(?:\.\d+)*", ... "old_version": r"1\.0", ... "new_version": r"1\.1", - ... "new_milestone": r"22", + ... "any_milestone": r"\d+", ... } """ + any_version: str old_version: str new_version: str - new_milestone: str + any_milestone: str class ReplacementDict(TypedDict): @@ -191,9 +193,10 @@ def get_replacements( milestone_numbers = get_milestone_numbers() next_version = get_next_milestone_version(new_version, milestone_numbers) patterns: PatternDict = { + "any_version": r"\d+(?:\.\d+)*", "old_version": re.escape(str(old_version)), "new_version": re.escape(str(new_version)), - "new_milestone": milestone_numbers[new_version], + "any_milestone": r"\d+", } replacements: ReplacementDict = { "new_version": str(new_version), @@ -303,7 +306,7 @@ def lookup_patterns( """ current_pattern_name, replacement_name = template_match.groups() - # example: template_match.groups() == ("new_milestone", "next_milestone") + # example: template_match.groups() == ("any_milestone", "next_milestone") if current_pattern_name not in PATTERN_NAMES: raise RuntimeError( f"Pattern name {current_pattern_name!r} for a current value is" diff --git a/src/darker/version.py b/src/darker/version.py index 6e6c5038b..a14402a97 100644 --- a/src/darker/version.py +++ b/src/darker/version.py @@ -1,3 +1,3 @@ """The version number for Darker is governed by this file""" -__version__ = "1.4.1" +__version__ = "1.4.2"