Skip to content

Commit

Permalink
consistent abbreviation of "compat" (#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanKarpinski authored and KristofferC committed Jun 13, 2018
1 parent ecf6448 commit 9517e77
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ If the compatibility for a dependency is not given, the project is assumed to be
Compatibility for a dependency is entered in the `Project.toml` file as for example:

```toml
[compatibility]
[compat]
Example = "0.4.3"
```

Expand Down
2 changes: 1 addition & 1 deletion src/Operations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ function collect_project!(ctx::Context, pkg::PackageSpec, path::String, fix_deps
fix_deps_map[pkg.uuid] = valtype(fix_deps_map)()
!isfile(project_file) && return false
project = read_project(project_file)
compat = get(project, "compatibility", Dict())
compat = get(project, "compat", Dict())
for (deppkg_name, uuid) in project["deps"]
vspec = haskey(compat, deppkg_name) ? Types.semver_spec(compat[deppkg_name]) : VersionSpec()
deppkg = PackageSpec(deppkg_name, UUID(uuid), vspec)
Expand Down
16 changes: 8 additions & 8 deletions src/Types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ end
function project_compatibility(ctx::Context, name::String)
v = VersionSpec()
project = ctx.env.project
compat = get(project, "compatibility", Dict())
compat = get(project, "compat", Dict())
if haskey(compat, name)
v = VersionSpec(semver_spec(compat[name]))
end
Expand Down Expand Up @@ -1021,13 +1021,13 @@ function pathrepr(ctx::Union{Nothing, Context}, path::String, base::String=pwd()
end

function project_key_order(key::String)
key == "name" && return 1
key == "uuid" && return 2
key == "keywords" && return 3
key == "license" && return 4
key == "desc" && return 5
key == "deps" && return 6
key == "compatibility" && return 7
key == "name" && return 1
key == "uuid" && return 2
key == "keywords" && return 3
key == "license" && return 4
key == "desc" && return 5
key == "deps" && return 6
key == "compat" && return 7
return 8
end

Expand Down
2 changes: 1 addition & 1 deletion test/repl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ temp_pkg_dir() do project_path; cd(project_path) do
open("Project.toml"; append=true) do io
print(io, """
[compatibility]
[compat]
JSON = "0.16.0"
"""
)
Expand Down

0 comments on commit 9517e77

Please sign in to comment.