Comments (10)
haha slipped my mind ;-)
from eta.
Most of Google's Python style is covered by the pep8
and pylint
linters:
pip install pep8
pip install pylint
pylint --generate-rcfile > ~/.pylintrc
Customize ~/.pylintrc
by setting the following values:
reports=no
max-line-length=80
output-format=colorized
To lint a file:
pep8 <file>
pylint <file>
Almost all of pep8's output is useful, and most of pylint's output is useful.
All the common editors (emacs, sublime text, pydev) can be setup to automatically run pep8/pylint on files.
from eta.
So my proposal here is that we:
(a) always try to follow the rules here (we may add new conventions over time)
https://github.com/voxel51/eta/blob/develop/core_dev_guide.md
(b) be otherwise familiar with the underlying Google Python style to guide our "subconscious" development practices:
https://google.github.io/styleguide/pyguide.html
(c) be diligent about running pep8
and pylint
on our source and obeying all reasonable recommendations
Then we can avoid talking about Python style in code chats!
from eta.
from eta.
Side note: it is terribly unfortunate that vim
is not listed in your list of common editors, be it the most commonly used editor since the dawn of unix.
from eta.
both pep8 and pylint issue errors/warnings when a sys.path.insert is before an import. we need to handle that to not always output such a warning for our code.
from eta.
Also, I think we can set these up to be run on a git commit (even locally) and disallow a commit if there are any errors we care about. May get annoying, but I think this is the only way.
from eta.
Furthermore, for those vim'rs among us. This will strip trailing whitespaces on write.
fun! <SID>StripTrailingWhitespaces()
let l = line(".")
let c = col(".")
let _s = @/
%s/\s\+$//e
call cursor(l, c)
let @/ = _s
endfun
autocmd FileType c,cc,cpp,java,python autocmd BufWritePre <buffer> :call <SID>StripTrailingWhitespaces()
This should be in your .vimrc.
I am considering making a vim-plugin to support Voxel51 formatting...
from eta.
Some more comments on configuring your pep8 and pylint configuration to meet our guidelines (this should be incorporated into the project files somehow).
For pylint, you can disable the single character variable warning by adding "C0103" to your disable line in the ~/.pylintrc
For pep8, if you make a configuration file (~/.config/pep8) that has the content
[pep8]
ignore=E402
Then you will not see the annoying error about the imports not at the beginning of the file.
from eta.
Custom ETA linting configurations now exist as of #25
from eta.
Related Issues (20)
- Shorthand for exposing all module parameters as tunable
- CLI: show help anytime a command is called with no args
- `core/datasets.py` split function validation assumes 2-class setting
- core/config.py parse_number fails on 'Infinity' HOT 1
- Update ETA Dockerfile to remove nvidia-docker dependency
- Pin explicit dependency versions in ETA install
- Sample select frames problem HOT 5
- Read images from URLs HOT 1
- ETA Dockerfile does not support visualiziation
- Add support for automatically extracting models that are archives
- Upload ETA infrastructure image to GitHub CDN
- Support TensorFlow 2
- Add support for ProgressBars to `eta.core.storage`
- [Discussion] Remove `Sphinx` dependency HOT 1
- Add support for windows HOT 1
- Support annotating video-level attributes
- Progress bar regression in `v0.8.2` HOT 1
- DeprecationWarning: pkg_resources is deprecated as an API
- [BUG] draw_labels method cannot parse unicode characters HOT 1
- `eta.core.web.download_file()` failing HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eta.