Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some code cleanup #44

Open
GoogleCodeExporter opened this issue Apr 27, 2015 · 7 comments
Open

Some code cleanup #44

GoogleCodeExporter opened this issue Apr 27, 2015 · 7 comments

Comments

@GoogleCodeExporter
Copy link

Hi all,

I've created a commit that adds a .gitignore that would allow for easier usage 
of a git checkout for actually running the code.

I've also change most py files to follow PEP 8, by changing tabs into spaces. 
There are a few typo fixes in there as well.

You can get the commit here: 
https://github.com/timstoop/ga-bitbot/commit/f345506c54454fa8afd115dea804b6caa48
dbb7c

Hope this helps!

Original issue reported on code.google.com by tim.st...@gmail.com on 7 Feb 2013 at 4:54

@GoogleCodeExporter
Copy link
Author

Scratch that for now, need to run through a lot more code because now there are 
indentation errors :S The whitespace usage was a little bit of a mess :)

Original comment by tim.st...@gmail.com on 7 Feb 2013 at 5:22

@GoogleCodeExporter
Copy link
Author

The html & js code was originally just slamed together so I could peek into the 
inner workings of the system. Eventually, wc_server.py will go away, replaced 
by server.js but there is a lot of clean up work (format,structure & removal of 
unused dependancies) to do first.  

I thought I cleaned up the mixed tab & spaces already but obviously there is 
more to do.

Regarding PEP 8, I'm sure the authors are much smarter than me but I can't 
bring myself to using spaces over tabs.




Original comment by brian.mo...@gmail.com on 8 Feb 2013 at 12:29

@GoogleCodeExporter
Copy link
Author

Yeah, lots of places with mixed tabs and spaces, which was the first I wanted 
to do something about, since it makes working on the code a lot nicer. The 
second is using the logging module for the output, since that allows a nicer 
way of redirecting and stuff.

Re: PEP 8, I don't think it has anything to do with A being better than B, 
rather, it's pretty common in the Python community to use the spaces instead of 
tabs. Most devs I know have their environment setup for the spaces, not for 
tabs. And since I work on several projects, I'd find it hard to use separate 
methods on multiple projects. Assuming you GPLed the code to get contributions, 
I think you'll get more contributions if you make it easy for people to work on 
the code. The tabs-spaces thing is a big part of that, I'm afraid. At least for 
me. So that's why I propose the change.

I'm a Vim user and have my python settings set up for spaces. I actually use 
the Tab key to create those spaces.

Original comment by tim.st...@gmail.com on 8 Feb 2013 at 1:13

@GoogleCodeExporter
Copy link
Author

Ok, started anew. Same place, though.

Currently it cleans up the files in /libs and adds a .gitignore. This also 
removes all bcfeed files out of datafeed/, since I don't think these should be 
in the repository. Please hit me on the head with a stick (not too big one, 
please) if they should remain there!

You can simply copy those files away before you pull and add them again once 
you're done. They should be ignored hence forth.

Original comment by tim.st...@gmail.com on 9 Feb 2013 at 9:44

@GoogleCodeExporter
Copy link
Author

https://github.com/timstoop/ga-bitbot/tree/upstream_code_cleanup is the place!

Original comment by tim.st...@gmail.com on 9 Feb 2013 at 9:45

@GoogleCodeExporter
Copy link
Author

I can't argue with your logic. 

I went ahead and cloned your repo and grabbed the .gitignore file. 

I found out I could use the command line tool 'expand' to convert from tabs to 
spaces. I did that instead of merging into my changes, which were made while 
still using tabs.

Original comment by brian.mo...@gmail.com on 12 Feb 2013 at 3:54

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

Thanks man, much appreciated.

You might also want to clean the files in datafeed, since I don't think those 
belong in the repository and they make each commit rather large. If you're 
running from your working directory, just copy the directory, run a 'git rm 
datafeed/bct*csv; git commit' and copy them back.

Another thing to clean up the code a bit, is running the following regex:

s/\s\+$//

It removed all whitespace and the end of lines, which there's rather a lot of. 
Just a slight nag, not important at all, it's my personal OCD :)

Original comment by tim.st...@gmail.com on 12 Feb 2013 at 8:57

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant