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
Inherit DarkerConfig from BaseConfig
It's in `darkgraylib.config`.
  • Loading branch information
akaihola committed Mar 8, 2024
commit a43bc33fdc9ed1eb28facb16a56b45a293525e4f
12 changes: 3 additions & 9 deletions src/darker/config.py
Original file line number Diff line number Diff line change
@@ -5,11 +5,12 @@
from argparse import ArgumentParser, Namespace
from dataclasses import dataclass, field
from pathlib import Path
from typing import Dict, Iterable, List, Optional, Set, TypedDict, Union, cast
from typing import Dict, Iterable, List, Optional, Set, Union, cast

import toml

from darker.black_compat import find_project_root
from darkgraylib.config import BaseConfig


class TomlArrayLinesEncoder(toml.TomlEncoder): # type: ignore
@@ -23,24 +24,17 @@ def dump_list(self, v: Iterable[object]) -> str:
UnvalidatedConfig = Dict[str, Union[List[str], str, bool, int]]


class DarkerConfig(TypedDict, total=False):
class DarkerConfig(BaseConfig, total=False):
"""Dictionary representing ``[tool.darker]`` from ``pyproject.toml``"""

src: List[str]
revision: str
diff: bool
stdout: bool
check: bool
isort: bool
lint: List[str]
config: str
log_level: int
color: bool
skip_string_normalization: bool
skip_magic_trailing_comma: bool
line_length: int
target_version: str
workers: int


class OutputMode: