Skip to content

Commit

Permalink
fix: coerce plugin options to concrete types
Browse files Browse the repository at this point in the history
  • Loading branch information
vberlier committed Jul 1, 2021
1 parent 3b6ea8d commit dd2de5a
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions beet/contrib/babelbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import logging
from csv import Dialect, DictReader, Sniffer
from typing import Dict, Iterable, Optional, Type, Union
from typing import Dict, List, Optional, Type, Union

from pydantic import BaseModel

Expand All @@ -28,7 +28,7 @@


class BabelboxOptions(BaseModel):
load: Iterable[str] = ()
load: List[str] = []
dialect: Optional[str] = None
filename_prefix: bool = False

Expand Down
4 changes: 2 additions & 2 deletions beet/contrib/function_header.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
]


from typing import Iterable, Optional
from typing import List, Optional

from pydantic import BaseModel

from beet import Context, configurable


class FunctionHeaderOptions(BaseModel):
match: Iterable[str] = ()
match: List[str] = []
template: Optional[str] = "function_header.mcfunction"


Expand Down
2 changes: 1 addition & 1 deletion beet/contrib/hangman.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@


class HangmanOptions(BaseModel):
match: Iterable[str] = ()
match: List[str] = []


def beet_default(ctx: Context):
Expand Down
6 changes: 3 additions & 3 deletions beet/contrib/load_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


from dataclasses import InitVar, dataclass, field
from typing import Any, Dict, Iterable, Optional, Type, TypeVar
from typing import Any, Dict, List, Optional, Type, TypeVar

import yaml
from pydantic import BaseModel
Expand All @@ -30,8 +30,8 @@


class LoadYamlOptions(BaseModel):
resource_pack: Iterable[str] = ()
data_pack: Iterable[str] = ()
resource_pack: List[str] = []
data_pack: List[str] = []


def beet_default(ctx: Context):
Expand Down
4 changes: 2 additions & 2 deletions beet/contrib/scoreboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
]


from typing import Iterable
from typing import List

from pydantic import BaseModel

Expand All @@ -16,7 +16,7 @@

class ScoreboardOptions(BaseModel):
function: str = "scoreboard"
tags: Iterable[str] = ("minecraft:load",)
tags: List[str] = ["minecraft:load"]


def beet_default(ctx: Context):
Expand Down

0 comments on commit dd2de5a

Please sign in to comment.