-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR fixes decoders/encoders for `allOf` and `anyOf` types, sanitises identifier names, various bug fixes, refactorings and dialyzer fixes. * Fixes and refactors the `allOf` and `anyOf` printers, such that they produce correct Elm code for decoding and encoding `all_of` and `any_of` JSON schema nodes. * Sanitises / Elmifies JSON schema identifiers, such that the Elm code output is valid Elm - Moves indentation- and naming-specific logic from `printer/util.ex` into a new `printer/utils` folder, - adjusts all printers to now use the `Naming.normalize_identifier()` function before sending identifier names to Elm code templates, and - adds tests for the 'sanitise identifier' feature. * Splits the `JS2E.Printer.Util` module into a whole `printer/utils` folder in order to increase cohesion, i.e. have one util module per relevant area of printing. * Fixes all dialyzer errors except for allOf/anyOf/oneOf printers * Improves documentation - Updates 'allOf' and 'anyOf' type descriptions to reflect new Elm decoders/encoders, - updates `README.md` to include a section on `js2e` error reporting, and - creates a `CONTRIBUTING.md` file, detailing what potential contributors should know before filing issues/PRs.
- Loading branch information
1 parent
b14b302
commit 0cd9f0d
Showing
54 changed files
with
2,141 additions
and
1,440 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# Contributing | ||
|
||
If you have found a bug, think I have misinterpreted the JSON schema spec | ||
somewhere, or have a proposal for a new feature, feel free to open an issue so | ||
we can discuss a proper solution. | ||
|
||
## Reporting bugs | ||
|
||
When reporting a bug, please include: | ||
|
||
- A short description of the bug, | ||
- JSON schema example that triggers the bug, | ||
- expected Elm output, and the | ||
- actual Elm output. | ||
|
||
## Pull requests | ||
|
||
Please do not create pull requests before an issue has been created and a | ||
solution has been discussed and agreed upon. | ||
|
||
When making a pull request ensure that: | ||
|
||
1. It solves one specific problem, and that problem has already been documented | ||
and discussed as an issue, | ||
2. the PR solves the problem as agreed upon in the issue, | ||
3. if it is a new feature, ensure that there is proper code coverage of the new | ||
feature, and | ||
4. the PR contains no compiler warnings or dialyzer warnings (and preferably no | ||
credo warnings). | ||
|
||
## Development | ||
|
||
The project is written in [Elixir](http://elixir-lang.org/) - as I found it to | ||
be a more suitable tool for the job than Elm - and uses the `mix` tool for | ||
building. | ||
|
||
#### Compiling | ||
|
||
Install dependencies | ||
|
||
mix deps.get | ||
|
||
Compile project | ||
|
||
mix compile | ||
|
||
and you are good to go. | ||
|
||
#### Tests | ||
|
||
Run the standard mix task | ||
|
||
mix test | ||
|
||
for test coverage run | ||
|
||
mix coveralls.html | ||
|
||
#### Static analysis | ||
|
||
Run dialyzer | ||
|
||
mix dialyzer | ||
|
||
Run credo | ||
|
||
mix credo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.