Skip to content

Commit

Permalink
chore: Array -> List
Browse files Browse the repository at this point in the history
  • Loading branch information
mtshiba committed Apr 4, 2024
1 parent cf01032 commit d522221
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/build.er
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ac = import "ansicolor"
{load_package_er_as_json!;} = import "metadata"

.compile_command! vers: Versions! =
cmd as Array!(Str, _) = !["erg", "compile"]
cmd as List!(Str, _) = !["erg", "compile"]
metadata = load_package_er_as_json!()
if! metadata.get("py_command") isnot! None, do!:
cmd.push! "--py-command"
Expand Down
2 changes: 1 addition & 1 deletion src/cfg.er
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sys = pyimport "sys"
.allow_dirty = Bool;
.certified = Bool;
.pip_check = Bool;
.args = Array(Str);
.args = List(Str);
}
.Config.
parse!(): Self =
Expand Down
4 changes: 2 additions & 2 deletions src/download.er
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Package = Class {
Package.
new as_name, version, path, type, used_in := "run" =
Package { .as_name; .version; .path; .type; .used_in }
.Versions! = Class Dict! { .PackageName: Array!(Package) }
.Versions! = Class Dict! { .PackageName: List!(Package) }
.Versions!|<: Show|.
__str__ ref self = "\{self::base}"
.Versions!|<: Eq|.
Expand Down Expand Up @@ -205,7 +205,7 @@ Package.
if! not(os.path.exists! "package.lock.er"), do!:
.Versions!.from_package_lock_er!::return None
data = load_er_as_json! "package.lock.er"
assert data["packages"] in Array { Str: Str }
assert data["packages"] in List { Str: Str }
.Versions!.from_packages! data["packages"]
install_if_not_exists!(ref self, pip_check: Bool) =
for! self::base.items(), ((pkg, vers),) =>
Expand Down
6 changes: 3 additions & 3 deletions src/publish.er
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ check_commit!(cfg: Config) =
panic """\{ac.RED}Error\{ac.RESET}: There are uncommitted changes in the current branch.
If you want to publish anyway, use the `--allow-dirty` flag."""

validate_package_er(metadata: {Str: Str or Array(Str) or Record}) =
validate_package_er(metadata: {Str: Str or List(Str) or Record}) =
if metadata.get("name") == None:
do panic "\{ac.RED}Error\{ac.RESET} in package.er: `name` is missing"
do assert metadata["name"] in Str, "\{ac.RED}Error\{ac.RESET} in package.er: `name` must be a string"
Expand All @@ -52,7 +52,7 @@ validate_package_er(metadata: {Str: Str or Array(Str) or Record}) =
"\{ac.RED}Error\{ac.RESET} in package.er: `type` must be \"app\", \"lib\", \"hybrid\" or \"decl\""
if metadata.get("authors") == None:
do panic "\{ac.RED}Error\{ac.RESET} in package.er: `authors` is missing"
do assert metadata["authors"] in Array(Str):
do assert metadata["authors"] in List(Str):
"\{ac.RED}Error\{ac.RESET} in package.er: `authors` must be a list of strings"

create_pr! cfg: Config, user_name, metadata =
Expand Down Expand Up @@ -82,7 +82,7 @@ create_pr! cfg: Config, user_name, metadata =
discard download_dependencies_on_demand! cfg
check_commit! cfg
metadata = load_package_er_as_json!()
assert metadata in {Str: Str or Array(Str) or Record}
assert metadata in {Str: Str or List(Str) or Record}
validate_package_er metadata
if! not(cfg.no_verify), do!:
check!(cfg)
Expand Down

0 comments on commit d522221

Please sign in to comment.