exercism / exercism/configlet

lint: should exit non-zero for a duplicate key name

Open
#347 0 comments 0 reactions 0 assignees View on GitHub
cmd: lint
Dominant language
Nim
Stars
23
Forks
17
Avg merge
13h 57m
Merged PRs (30d)
1

Description

A duplicate key is technically valid JSON [1], but recommended against (depending on the JSON spec) and is generally less portable.

But for our use case, any addition of a duplicate key is almost certainly unintended. So we should produce an error, rather than silently accepting it. I believe our Ruby JSON parser silently accepts it.

See also https://github.com/exercism/configlet/issues/312

[1] From section 6 of https://www.ecma-international.org/wp-content/uploads/ECMA-404_2nd_edition_december_2017.pdf:

> ### 6 Objects
>
> An object structure is represented as a pair of curly bracket tokens surrounding zero or more name/value pairs.
> A name is a *string*. A single colon token follows each name, separating the name from the *value*. A single
> comma token separates a *value* from a following name. The JSON syntax does not impose any restrictions on
> the *strings* used as names, **does not require that name *strings* be unique**, and does not assign any
> significance to the ordering of name/value pairs. These are all semantic considerations that may be defined by
> JSON processors or in specifications defining specific uses of JSON for data interchange.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.