-
-
Notifications
You must be signed in to change notification settings - Fork 361
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WIP] Set up the structure for the nextercism CLI
- Loading branch information
Katrina Owen
committed
Aug 4, 2017
1 parent
c131bc9
commit 75fa9d2
Showing
589 changed files
with
187,612 additions
and
228,081 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,65 @@ | ||
# Contributing Guide | ||
|
||
First, thank you! :tada: | ||
Exercism would be impossible without people like you being willing to spend time and effort making things better. | ||
|
||
## Dependencies | ||
|
||
You'll need Go version 1.7 or higher. Follow the directions on http://golang.org/doc/install | ||
|
||
## Development | ||
|
||
If you've never contributed to a Go project before this is going to feel a little bit foreign. | ||
|
||
The TL;DR is: **don't clone your fork**, and it matters where on your filesystem the project gets cloned to. | ||
|
||
If you don't care how and why and just want something that works, follow these steps: | ||
|
||
1. [fork this repo][fork] | ||
1. `go get github.com/exercism/cli/exercism` | ||
1. `cd $GOPATH/src/github.com/exercism/cli` | ||
1. `git remote set-url origin https://github.com/<your-github-username>/cli` | ||
1. `go get -t ./...` | ||
|
||
Then make the change as usual, and submit a pull request. Please provide tests for the changes where possible. | ||
|
||
If you care about the details, check out the blog post [Contributing to Open Source Repositories in Go][contrib-blog] on the Splice blog. | ||
|
||
## Running the Tests | ||
|
||
To run the tests locally, use | ||
|
||
``` | ||
go test $(go list ./... | grep -v vendor) | ||
``` | ||
|
||
As of Go 1.9 this is simplified to `go test ./...`. | ||
|
||
## Manual Testing against Exercism | ||
|
||
You can build whatever is in your local, working copy of the CLI without overwriting your existing Exercism | ||
CLI installation by using the `go build` command: | ||
|
||
``` | ||
go build -o testercism exercism/main.go | ||
``` | ||
|
||
This assumes that you are standing at the root of the exercism/cli repository checked out locally, and it will put a binary named `testercism` in your current working directory. | ||
|
||
You can call it whatever you like, but `exercism` would conflict with the directory that is already there. | ||
|
||
Then you call it with `./testercism`. | ||
|
||
You can always put this in your path if you want to run it from elsewhere on your system. | ||
|
||
We highly recommend spinning up a local copy of Exercism to test against so that you can mess with the database (and so you don't accidentally break stuff for yourself in production). | ||
|
||
[TODO: link to the nextercism repo installation instructions, and explain how to reconfigure the CLI] | ||
|
||
### Building for All Platforms | ||
|
||
In order to cross-compile for all platforms, run `bin/build-all`. The binaries | ||
will be built into the `release` directory. | ||
|
||
[fork]: https://github.com/exercism/cli/fork | ||
[contrib-blog]: https://splice.com/blog/contributing-open-source-git-repositories-go/ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,75 +1,18 @@ | ||
# Exercism Command-line Interface | ||
# Exercism Command-line Interface (CLI) | ||
|
||
[](https://travis-ci.org/exercism/cli) | ||
[](http://24pullrequests.com) | ||
|
||
The CLI provides a way to do the problems on [exercism.io](http://exercism.io). | ||
The CLI is the link between the [Exercism][exercism] website and your local work environment. It lets you download exercises and submit your solution to the site. | ||
|
||
**Important**: If you're looking for instructions on how to install the CLI. Please read [Installing the CLI](http://exercism.io/clients/cli) | ||
This CLI ships as a binary with no additional runtime requirements. | ||
|
||
This CLI ships as a binary with no additional runtime requirements. This means | ||
that if you're doing the Haskell problems on exercism you don't need a working | ||
Python or Ruby environment simply to fetch and submit exercises. | ||
## Installing the CLI | ||
|
||
## Dependencies | ||
[TODO: link to the installation guide on Nextercism] | ||
|
||
Go version 1.6 or higher | ||
|
||
## Installing Go | ||
|
||
Follow the directions on http://golang.org/doc/install | ||
|
||
## Development | ||
|
||
1. fork this repo | ||
1. `go get github.com/exercism/cli/exercism` | ||
1. `cd $GOPATH/src/github.com/exercism/cli` | ||
1. `git remote set-url origin https://github.com/<your-github-username>/cli` | ||
1. `go get -t ./...` | ||
1. Make the change. | ||
1. Submit a pull request. | ||
|
||
Please provide tests for the changes where possible. | ||
|
||
To run the tests locally, use `go test ./...` | ||
|
||
At the moment the CLI commands are not tested, so if you're adding a new | ||
command don't worry too hard about tests. | ||
|
||
## Testing against exercism.io | ||
|
||
If you want to test a change by using your own fork to try `exercism` commands, | ||
such as `exercism fetch` or `exercism submit`, against the exercism.io site, it | ||
is advisable that you set up and run a [local development environment](https://github.com/exercism/exercism.io/blob/master/docs/setting-up-local-development.md), | ||
and configure the CLI to submit to your local machine, which would let you | ||
easily delete and recreate submissions, without fear of breaking the exercism.io | ||
site. | ||
|
||
## Building | ||
|
||
To build the binary for your platform run | ||
|
||
``` | ||
go install github.com/exercism/cli/exercism | ||
``` | ||
|
||
or | ||
|
||
``` | ||
go build -o out/exercism exercism/main.go | ||
``` | ||
|
||
The resulting binary can be found in `out/exercism` (Linux, Mac OS X) or `out/exercism.exe` (Windows). | ||
|
||
In order to cross-compile for all platforms, run `bin/build-all`. The binaries | ||
will be built into the `release` directory. | ||
|
||
## Domain Concepts | ||
|
||
- **Language** is the name of a programming language. E.g. C++ or Objective-C or JavaScript. | ||
- **Track ID** is a normalized, url-safe identifier for a language track. E.g. `cpp` or `objective-c` or `javascript`. | ||
- **Problem** is an exercism exercise. | ||
- **Problem Slug** is a normalized, url-safe identifier for a problem. | ||
- **Iteration** is a solution that a user has written for a particular problem in a particular language track. A user may have several iterations for the same problem. | ||
## Contributing | ||
|
||
If you wish to help improve the CLI, please see the [Contributing guide][contributing]. | ||
|
||
[exercism]: http://exercism.io | ||
[contributing]: /CONTRIBUTING.md |
Oops, something went wrong.