Harkishen-Singh / Jarvis-personal-assistant

Comfort of a personal assistant for Linux systems. Currently features native google, yahoo, bing searches, weather conditions, videos from youtube and looking up for images as well, all in a very reliable structure and UI.
45 stars 45 forks source link

Add gofmt script to enforce Go formatting #219

Closed soulclimberchick closed 4 years ago

soulclimberchick commented 4 years ago

This PR solves issue #164

What does this PR do? added gofmt -l which checks for go formatting issues and logs them in the directory it was run from.

Any background context you want to provide? this change is made in .travis.yml file under the before-install: action. Please give me any and all feedback. This is my first contribution and pull request on an open source project! Thanks! I will be adding an additional pull request for some documentation change requests!

soulclimberchick commented 4 years ago

forgot to add - passed tests in Travis CI, but there were a couple of unrelated errors in the test:


389Speaking ->  here are the top search results
3902020/08/16 04:19:50 04:19:50.599 Error ▶ ERRO 001 exec: "mplayer": executable file not found in $PATH
391--- FAIL: TestGoogleSearch (6.02s)
392panic: Post http://localhost:3000/message: EOF [recovered]
393 panic: Post http://localhost:3000/message: EOF

and 

``` testing.tRunner(0xc000116100, 0x6f30a8)
403 /home/travis/.gimme/versions/go1.11.13.linux.amd64/src/testing/testing.go:827 +0xbf
404created by testing.(*T).Run
405 /home/travis/.gimme/versions/go1.11.13.linux.amd64/src/testing/testing.go:878 +0x35c
406FAIL command-line-arguments  6.022s
407The command "go test service/controllers/controllers_test.go" exited with 1. 

Ending with 
``` The command "xvfb-run -s "-screen 0 1920x1080x16" -a mocha test.js" exited with 1.
soulclimberchick commented 4 years ago

Realized this doesn't give an exit code. Looking for a better solution.

soulclimberchick commented 4 years ago

Added a script that runs at build and fails the build if it detects any formatting errors.

Note there were two errors when running Travis CI relating to an executable file and selenium unrelated to this issue.

The script runs successfully and tests showed it failing when formatting errors were found and passing when formatting errors were cleaned up.

Harkishen-Singh commented 4 years ago

Thank you @soulclimberchick for this PR and showing your interest in contributions.

This PR looks good, so I will merge this with the upstream (thought tests fail). However, I do want to make you aware that this project is being ported to NodeJS due to lack of some specific libraries (and also fewer contributors from the community), a reason why the go-code & tests lacked support at present.

The node-master branch is the new master branch that will be merged with the master, in the future.

So, if you want to contribute specific to go-code, I will advise you to choose our more active project that is in use and active development in Go. You can take a look at bench-routes which is purely in Go. It is in very active development and release process and we would love to get active contributions in it. If you find that project interesting, all related documents should be easily available in the repository. Feel free to ask for any help or queries.

Here is the gitter channel of bench-routes in case you require any help: https://gitter.im/bench-routes/community

soulclimberchick commented 4 years ago

Thank you so much for my first opportunity to contribute to an open source project. And thank you for taking the time to let me know about the transition and the other opportunity on bench-routes! I will definitely hop over there and see what I can contribute! Happy coding!