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 common parts with Graylint into Darkgraylib #501

Merged
merged 30 commits into from
Mar 8, 2024
Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
c7ce127
Move code from `command_line.py` to Darkgraylib
akaihola Feb 16, 2023
6e0dbc5
Move code from `__main__.py` to Darkgraylib
akaihola Feb 16, 2023
a4e8e4a
Command line now mainly parsed in `darkgraylib`
akaihola Feb 19, 2023
debcbe1
Move linting support implementation to `graylint`
akaihola Feb 23, 2023
a43bc33
Inherit `DarkerConfig` from `BaseConfig`
akaihola Feb 23, 2023
c8170af
Move `RevisionRange` to `darkgraylib.git`
akaihola Feb 23, 2023
77af0de
Bring `--output` validation back
akaihola Mar 25, 2023
3124fc4
Update to `lint-action@v2.3.0`
akaihola Mar 25, 2023
6673891
Mark the Darker package as typed
akaihola Mar 25, 2023
0cccd56
Add `darkgraylib` and `graylint` as dependencies
akaihola Jul 9, 2023
20a67cb
Add `darkgraylib` and `graylint` for Pylint & Mypy
akaihola Jul 9, 2023
c91fd65
Consider `darkgraylib` and `graylint` first party
akaihola Jul 9, 2023
095c769
Don't use Pylint to check import order
akaihola Jul 9, 2023
b4752fe
Move `TextDocument` class to `darkgraylib`
akaihola Jul 9, 2023
56c34b3
Move `git_repo` fixture to `darkgraylib`
akaihola Jul 12, 2023
c39ca16
Move parts of `darker.config` into `darkgraylib`
akaihola Aug 7, 2023
92d12a0
Move Black cache clear plugin to `darkgraylib`
akaihola Aug 7, 2023
4965138
Move some `darker.config` tests into `darkgraylib`
akaihola Aug 7, 2023
e86947c
fix darkgraylib.testtools import typo
akaihola Aug 7, 2023
e2cdd62
Move highlighting support into `darkgraylib`
akaihola Aug 7, 2023
825fa7a
Move parts of `darker.diff` into `darkgraylib`
akaihola Aug 7, 2023
68fe848
Update `--help` output in README
akaihola Mar 2, 2024
eb842ab
Import testhelpers from new place in Darkgraylib
akaihola Mar 2, 2024
1479fa4
Move `black_compat` module to Darkgraylib
akaihola Mar 3, 2024
3fca1df
Move `argparse_helpers` and tests into Darkgraylib
akaihola Mar 3, 2024
c754942
Move `raises_if_exception()` to Darkgraylib
akaihola Mar 3, 2024
a27b9cf
Move `raises_or_matches()` to Darkgraylib
akaihola Mar 3, 2024
a3615b3
Use `lru_cache` clear fixture at test module level
akaihola Jan 30, 2023
e230240
Move some Git helpers to Darkgraylib
akaihola Mar 3, 2024
889844a
Move some `utils.py` helpers to Darkgraylib
akaihola Mar 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Move black_compat module to Darkgraylib
  • Loading branch information
akaihola committed Mar 8, 2024
commit 1479fa4dba95850ee7d2d5651c22fdc4a9355748
4 changes: 2 additions & 2 deletions src/darker/__main__.py
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@
from pathlib import Path
from typing import Collection, Generator, List, Optional, Tuple

import darker.black_compat
from darker.black_diff import (
BlackConfig,
filter_python_files,
@@ -39,6 +38,7 @@
from darker.import_sorting import apply_isort, isort
from darker.utils import GIT_DATEFORMAT, DiffChunk, debug_dump, glob_any
from darker.verification import ASTVerifier, BinarySearch, NotEquivalentError
from darkgraylib.black_compat import find_project_root
from darkgraylib.config import show_config_if_debug
from darkgraylib.git import RevisionRange
from darkgraylib.highlighting import colorize, should_use_color
@@ -562,7 +562,7 @@ def main( # pylint: disable=too-many-locals,too-many-branches,too-many-statemen
# In other modes, only reformat files which have been modified.
if git_is_repository(root):
# Get the modified files only.
repo_root = darker.black_compat.find_project_root([str(root)])
repo_root = find_project_root([str(root)])
changed_files = {
(repo_root / file).relative_to(root)
for file in git_get_modified_python_files(paths, revrange, repo_root)
21 changes: 0 additions & 21 deletions src/darker/black_compat.py

This file was deleted.

2 changes: 1 addition & 1 deletion src/darker/import_sorting.py
Original file line number Diff line number Diff line change
@@ -4,11 +4,11 @@
from pathlib import Path
from typing import Any, Collection, List, Optional, TypedDict

from darker.black_compat import find_project_root
from darker.diff import diff_chunks
from darker.exceptions import IncompatiblePackageError, MissingPackageError
from darker.git import EditedLinenumsDiffer
from darker.utils import DiffChunk, glob_any
from darkgraylib.black_compat import find_project_root
from darkgraylib.utils import TextDocument

try: