Contributing to json_schema

Looking to contribute something to the json_schema library? Here's how you can help.

Coding standards

A lot can be gained by writing code in a consistent way. Moreover, always remember that code is written and maintained by people. Ensure your code is descriptive, well commented, and approachable by others.

ALWAYS adhere to the Dart Style Guide. Please take the time to read it if you have never done so.

 

General formatting guidelines

  • AVOID lines longer than 120 characters.
  • AVOID using dartfmt as an excuse to ignore good judgement about whether your code is readable and approachable by others.

   

Using the issue tracker

The issue tracker is the preferred channel for bug reports and feature requests, but please follow the guidelines:

  • Fill out the template we've provided.

  • Be Professional

    • Please do not derail or troll issues. Keep the discussion on topic and respect the opinions of others.
  • Not that Professional

    • Feel free to include relevant animated gifs to drive home your message / request.

 

Bug reports

A bug is a demonstrable problem that is caused by the code in the repository.

Good bug reports are extremely helpful - thank you!_

Guidelines for bug reports:

  1. Search for existing issues. Duplicate issues can become cumbersome, and you'd help us out a lot by first checking if someone else has reported the same issue. Moreover, the issue may have already been resolved with a fix available.

  2. Record a screencast of yourself reproducing the issue.

  3. Be sure the problem exists in json_schema's code by building a reduced test case that one of the reviewers can pull locally and test out.

  4. Share as much information as possible. Include operating system and version, browser and version, etc. where appropriate.

Always include steps to reproduce the bug.

Example Bug Report:

Short and descriptive example bug report title

A summary of the issue and the browser/OS environment in which it occurs. If suitable, include the steps required to reproduce the bug.

  1. This is the first step
  2. This is the second step
  3. Further steps, etc.

<url> - a link to branch with the reduced test case

Any other information you want to share that is relevant to the issue being reported. This might include the lines of code that you have identified as causing the bug, and potential solutions (and your opinions on their merits).

 

Feature requests

Feature requests are welcome. But take a moment to find out whether your idea fits with the scope and aims of the project. It's up to you to make a strong case to convince the json_schema team of the merits of this feature. Please provide as much detail and context as possible.

 

Pull requests

Good pull requests - patches, improvements, new features - are a fantastic help. They should remain focused in scope and avoid containing unrelated commits.

Please ask first before embarking on any significant pull request (e.g. implementing features, refactoring code, porting to a different language), otherwise you risk spending a lot of time working on something that the project's lead developers might not want to merge into the project.

Please adhere to the Dart Style Guide for all changes contained in your pull requests.

Adhering to the following process is the best way to get your work included in the project:

  1. Fork the project, clone your fork, and configure the remotes:

    # Navigate to the directory where you store repos locally
    cd ~/your-local-git-repo-spot
    # Clone your fork of the repo into the current directory
    git clone git@github.com:<your-username>/json_schema
    # Navigate to the newly cloned directory
    cd ~/your-local-git-repo-spot/json_schema
    # Assign the repo you forked from to a remote called "upstream"
    git remote add upstream git@github.com:Workiva/json_schema
    
  2. If you cloned a while ago, get the latest changes from upstream:

    git checkout master
    git pull upstream master
    
  3. Create a new topic branch that will contain your feature, change, or fix:

    git checkout -b <topic-branch-name>
    
  4. Commit your changes in logical chunks. Please adhere to these git commit message guidelines or your code is unlikely be merged into the master branch. Optionally, you can use Git's interactive rebase feature to tidy up your commits before making them public.

  5. Write tests for your changes.

  6. There are no exceptions.

  7. If you're having trouble, reach out in your PR about how to best go about testing your changes.

  8. If you have merge conflicts, locally merge the upstream master branch into your topic branch:

    git pull upstream master
    
  9. Push your topic branch up to your fork:

    git push origin <topic-branch-name>
    
  10. Open a Pull Request with a clear title and description - following all the issue guidelines listed above.

   

Developer Workflow

The json_schema developer workflow couldn't be any more simple!

When you're ready to run the tests... run:

pub run dart_dev test