GithubHelp home page GithubHelp logo

exercism / cli Goto Github PK

View Code? Open in Web Editor NEW
1.3K 49.0 340.0 11.58 MB

A Go based command line tool for exercism.org.

Home Page: https://exercism.org/docs/using/solving-exercises/working-locally

License: MIT License

Go 96.00% Shell 4.00%
community-contributions-paused

cli's Introduction

Exercism Command-line Interface (CLI)

CI Go Report Card

The CLI is the link between the Exercism website and your local work environment. It lets you download exercises and submit your solution to the site.

This CLI ships as a binary with no additional runtime requirements.

Installing the CLI

Instructions can be found at exercism/cli/releases

Contributing

If you wish to help improve the CLI, please see the Contributing guide.

cli's People

Contributors

aldraco avatar ambroff avatar ccallergard avatar dependabot[bot] avatar ekingery avatar erikschierboom avatar exercism-bot avatar fabientregan avatar ferhatelmas avatar glennj avatar gliptak avatar jdsutherland avatar john-goff avatar jrank2013 avatar katrinleinweber avatar kytrinyx avatar lcowell avatar manusajith avatar mikegehard avatar neslom avatar nywilken avatar objarni avatar petertseng avatar qulogic avatar robphoenix avatar smarticles101 avatar tonkpils avatar williandrade avatar zabawaba99 avatar zapanton avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cli's Issues

Path with spaces causes panic

Copied from exercism/exercism#1458, reported by @basbossink


When setting up exercism 1.5.0 amd64 for the first time on a 64-bit Windows 7 system. When selecting the following project path: C:\Users\bas\Documents\My Dropbox\projects\exercism the panic below is shown:

panic: Scan: expected newline

goroutine 1 [running]:
main.askForConfigInfo(0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /Users/kytrinyx/code/go/src/github.com/exercism/cli/exercism.go:47 +0x91
b
main.func┬À004(0xc0800c5080)
        /Users/kytrinyx/code/go/src/github.com/exercism/cli/main.go:135 +0x60
github.com/codegangsta/cli.Command.Run(0x68f780, 0x5, 0x68f3e0, 0x1, 0x6d0070, .
..)
        /Users/kytrinyx/code/go/src/github.com/codegangsta/cli/command.go:73 +0x
915
github.com/codegangsta/cli.(*App).Run(0xc080094500, 0xc08008b740, 0x2, 0x2, 0x9,
 ...)
        /Users/kytrinyx/code/go/src/github.com/codegangsta/cli/app.go:101 +0x7a5

main.main()
        /Users/kytrinyx/code/go/src/github.com/exercism/cli/main.go:294 +0x320

Backtrace when trying to submit

Hi, I got an error when I was trying to submit one of my exercises, and I figured out what I did wrong, but @mjc called the error a "backtrace" and said I should let you know, so I'm letting you know.

I was logging into exercism for the first time from this computer and I missed that it was asking me for my projects path, and I tried to submit an exercise right away. I'm attaching a screensnip of the error I got.

submit error

Residual state after unsubmitting

In the case where I already submitted a solution to a problem, if I sumit a second one and then unsubmit it, the homepage tells me You don't currently have any pending submissions. instead of showing the previous submission.

Problems with restore

exercism restore in the CLI doesn't update the following exercises correctly or at all:

-beer-song
-binary-search
-custom-set
-food-chain (outdated test file)
-house
-triangles (no test file?)

Can only submit paths relative to exercismDirectory

This doesn't work.

03:33:36 pkoch@new-host-2:~/Desktop/exercism/python/bob
$ ~/Desktop/go-exercism/out/exercism submit bob.py
There was an issue with your submission: Status: 500, Error:

You're forced to do this instead:

03:33:43 pkoch@new-host-2:~/Desktop/exercism
$ ~/Desktop/go-exercism/out/exercism submit python/bob/bob.py
For feedback on your submission visit http://exercism.io/pkoch/python/bob.

Is this the intended behaviour? It caught me off guard.

"exercism login" could create the projects directory

I thought exercism could create the projects directory if it doesn't exist. Now I (entered a new, nonexisting directory) got an error and the app exited.

I can imagine that it might be a bit complicated depending on the OS and the rights on the directory, but I would like if I could just enter the directory and it would get created if it didn't exist.

make exercism binary "go get"-able

See the second section of this article: http://blog.golang.org/organizing-go-code

It would be great to be able to type "go get github.com/msgehard/go-exercism/exercism" to build and install the command line tool.

To handle the external dependencies, check a copy of them into your repo under third_party/foo, and rewrite the import paths. This is the approach we take internally at Google and in the camlistore.org project. It means you don't need to mess around with git sub-repositories either, which is either a plus or a minus depending on how you look at it.

Do I need to install Go?

Sorry for the silly question (but it's not mentioned anywhere) - but do I need to install Go-programming language to use cli?

Is there any special instructions I need to follow in doing so?
For example, after installing Go, and trying to run "go run exercism.go" I get the:
cannot find package github.com/exercism/cli/configuration error.

I am using Windows 7, and 32bit version of go.
Thank you, can't wait to try this out!

Error when building executable (via bin/build) (Ubuntu 13.10 64bit)

When I try to run bin/build on my system I get the following message:

# exercism-cli
./main.go:243: app.Run(os.Args) used as value

And the executable is not produced in the out directory.

I don't know Go at all, but just as a test I removed the error checking code that it appeared to be complaining about and the executable was successfully built.

Can't fetch assignments, other than the default ones

Not sure if this is supported in exercism (couldn't find any reference on the site), but I assume it is:

I tried to fetch go's assignment, but I got 400:

exercism fetch go bob
Error fetching assignments. HTTP Status Code: 400

I've checked the github page and it seems that there is the go assignment that I tried to fetch.

500 error on submit

I just completed the 1st Clojure exercise, and am getting a server error on submit.

C:\dev\exercism>exercism s projects\clojure\bob\bob.clj
There was an issue with your submission: Status: 500, Error:

As you can see, the error response is blank. I am running Windows 64-bit, and executing the exercism program from the directory where it was unzipped. The relative path is correct.

"app.Run(os.Args) used as value"

Hey, I'm trying to compile the client on Ubuntu, and get as far as running go get in the project directory, but it fails with the following:

atul@ubuntu:~/gocode/src/exercism-cli$ go get
# exercism-cli
./main.go:243: app.Run(os.Args) used as value

(I've cloned the directory as exercism-cli to avoid ambiguity.)

Any thoughts? I'm very unfamiliar with go, so sorry if this is a noob question.

Mark new exercises

Depends on exercism/x-api#15

Once the API is delivering an extra field, the CLI can highlight the fresh exercises.

move code into a src directory for easier development/build setup

I haven't done much work in go but I wonder if the source code was moved into a ./src directory under the project, would it mean it'd be easier to develop?

It feels (and please forgive me as I'm learning about go) like you could have instructions that did something like

clone the repo
add (or edit) your GOPATH variable to include that repo directory
jump into the src directory
run go get
etc...

It seems odd that I have to put this in a go directory as opposed to being able to clone and work on the source in the directory of my choosing. And perhaps, restructuring the repo would let that work out.

If i'm wrong, please let me know and we can close this issue.

Reduce number of file used to implement configuration package

I was reading through the configuration package code and I was noticing that it was difficult to see how the pieces fit together because of how many files the code is spread across. This also makes it hard to find the implementation of a particular function.

I think it was a good move to extract the configuration related code it to it's own package, but I'm wondering if it might be a good idea to reduce the number of files used to implement it. I was thinking that home_dir.go and replace_tilde.go could be moved in to path_util.go and the remaining code could be collapsed in to config.go.

What do you think about this ?

Login does not tell you where it wrote your credentials

Current Gem:

exercism login
Your GitHub username: mgehard
Your exercism.io API key: 1fb5b0f39cf40ab7ac594fb8a87f11728aa04233
What is your exercism exercises project path?
Press Enter to select the default (/Users/msgehard/workspace/exercism/testing):

Your credentials have been written to /Users/msgehard/.exercism

Say so when a trail is exhausted

exercism fetch now tells me:

$ exercism fetch
clojure - bob
…
python - word-count
ruby - matrix
…
ruby - largest-series-product
scala - word-count
Exercises written to /Users/henrik/Dropbox/Code/exercism

Before, the next Ruby exercise up has appeared as the bottom of the list of Ruby exercises, but now it lists largest-series-product which I've already done. I suspect this is because I've exhausted the trail, or the trail order has changed or something.

Maybe the tool could say something like "No more exercises in the Ruby trail! Try another trail, help review submissions or contribute an exercise of your own."

Mark completed tracks

When there are no new exercises in a language, there should be some sort of notification to that effect.

Right now it's incredibly confusing, as it marks the last exercise as the new one, even though it's been completed earlier.

Homebrew Formula

So, I was trying to create a homebrew formula to install exercism cli, but I have no experience in creating brew formulas, nor with golang ecosystem, so I failed wonderfully.

I would appreciate if someone could build one or help me in the task.

Config file should have the extension .json

The file is a .json file, not a .go file.

To fix this we'll need a workaround that moves an .exercism.go file before any command that requires it for the lifetime of the 1.x version of the library.

Originally reported in tandem with another issue in #24

Submit command fails with "Error parsing API response"

For context, I submitted my first two iterations via an OS X machine.

I was then at a different computer--an Ubuntu server VM running under Win7--and configured exercism on the VM. I "checked out" (is that the right word for it?) the same test exercise, copied and pasted my latest iteration into bob.rb and made some changes, successfully completed exercism login, and then tried resubmitting with exercism submit bob.rb, which produced the following result:

There was an issue with your submission: Error parsing API response: [json: cannot unmarshal number into Go value of type string]

However, it does seem like the actual third iteration made it onto the website here.

make the exercises path if it doesn't exist

I've never done Go before, but I could try to figure it out if no one else wants to tackle this. I just think it'd be friendlier if the CLI would make the directory for your exercises if it doesn't already exist, so I won't get this:

What is your exercism exercises project path?
Press Enter to select the default (/Users/sarah):
> /Users/sarah/code/exercism
panic: lstat /Users/sarah/code/exercism: no such file or directory

goroutine 1 [running]:
main.askForConfigInfo(0x0, 0x0, 0x0, 0x0, 0x0, ...)
  /Users/kytrinyx/code/go/src/github.com/exercism/cli/main.go:261 +0x6c7
main.func·004(0xc20008e520)
  /Users/kytrinyx/code/go/src/github.com/exercism/cli/main.go:101 +0x3c
github.com/codegangsta/cli.Command.Run(0x285a20, 0x5, 0x285680, 0x1, 0x2c2af0, ...)
  /Users/kytrinyx/code/go/src/github.com/codegangsta/cli/command.go:55 +0x658
github.com/codegangsta/cli.(*App).Run(0xc2000c0150, 0xc20008e000, 0x2, 0x2)
  /Users/kytrinyx/code/go/src/github.com/codegangsta/cli/app.go:64 +0x567
main.main()
  /Users/kytrinyx/code/go/src/github.com/exercism/cli/main.go:229 +0x21a

goroutine 2 [syscall]:

bash completion script

I'm not sure how to integrate this into the cli project, but I created a (very simple) bash completion script to augment the cli.

_exercism()¬
 {¬
   cur=${COMP_WORDS[COMP_CWORD]}¬
   COMPREPLY=( $( compgen -W 'current demo fetch login logout peek restore submit unsubmit whoami help' -- $cur ) )¬
 }¬
 complete -o default -o nospace -F _exercism exercism

Is this something that would be useful in this (or another) project?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.