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

Merge project with maintained version #133

Open
wants to merge 32 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
f166fba
Refactored gitstatus.py
starcraftman May 25, 2018
56f0358
FIX: #1 See pcmd_error TODO
starcraftman May 25, 2018
684d615
FIX: Prompt was not displaying.
starcraftman May 25, 2018
3a5dec4
FIX: Regression, unhandled exception.
starcraftman May 25, 2018
dca58dc
Stray unicode flag, not needed.
starcraftman May 25, 2018
7e86fd8
Ooops, typo.
starcraftman May 25, 2018
e245593
FIX: #6 Examine compute_ahead_behind, discrepancy
starcraftman May 26, 2018
ee1c4c3
Basic tox configuration to test gitstatus.py
starcraftman May 26, 2018
7d138e9
Initial basic set of tests.
starcraftman May 26, 2018
3e6db1a
Working tests for conflicts and remote.
starcraftman May 26, 2018
3269438
FIX: Tests work in tox.
starcraftman May 27, 2018
a877603
Implement travis build for python
starcraftman May 27, 2018
f78f234
Report test coverage to terminal
starcraftman May 27, 2018
4766cdf
FIX: #3 Show [master L] when branch local only.
starcraftman May 27, 2018
10d8a9c
FIX: #7 Change compute_stats
starcraftman May 28, 2018
e93f615
Better separation of funcs.
starcraftman May 28, 2018
fba5070
FIX: #12 Speedup by taking input from STDIN
starcraftman May 28, 2018
6fda93e
Simply enable STDIN gitstatus.py
starcraftman May 28, 2018
6e401d9
FIX: stderr to gitstatus stdin
starcraftman May 29, 2018
bd26fbb
Partial fix.
starcraftman May 30, 2018
87774a8
FIX: #13 Find root of active git project
starcraftman May 30, 2018
2b1069b
FIX: #4 Allow opt-in to show upstream
starcraftman May 29, 2018
f2ca95e
Allow setting python interpreter.
starcraftman May 31, 2018
c6f3567
Allow abbreviated show upstream.
starcraftman Jun 2, 2018
814dc53
Fork note.
starcraftman Jun 2, 2018
e02d4b1
FIX #16: Reset color in prefix
starcraftman Jun 4, 2018
4e45c4f
FIX #17: handle repo lacking initial commit
starcraftman Jun 4, 2018
bec2226
FIX #14: Rebase in progress indicator
starcraftman Jun 5, 2018
fab5894
FIX #11: When merging indicate in prompt
starcraftman Jun 5, 2018
7bb9ea5
Guard needed while haskell lags behind.
starcraftman Jun 5, 2018
f704934
FIX #21: Fix order of gitstatus.py & zshrc.sh
starcraftman Jun 16, 2018
11b83ba
FIX #20: [exception] invalid literal for int()
starcraftman Jun 16, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
src/.bin
.coverage
.python-version

# Directories
src/.bin
.cache/
**/__pycache__
.pytest_cache
**/.stack-work
.tox
263 changes: 263 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,263 @@
[MASTER]

# Specify a configuration file.
#rcfile=

# Python code to execute, usually for sys.path manipulation such as
# pygtk.require().
#init-hook=

# Add files or directories to the blacklist. They should be base names, not
# paths.
ignore=CVS,.git,.tox,venv

# Pickle collected data for later comparisons.
persistent=yes

# List of plugins (as comma separated values of python modules names) to load,
# usually to register additional checkers.
load-plugins=


[MESSAGES CONTROL]

# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
# multiple time. See also the "--disable" option for examples.
#enable=

# Disable the message, report, category or checker with the given id(s). You
# can either give multiple identifiers separated by comma (,) or put this
# option multiple times (only on the command line, not in the configuration
# file where it should appear only once).You can also use "--disable=all" to
# disable everything first and then reenable specific checks. For example, if
# you want to run only the similarities checker, you can use "--disable=all
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes
#
# W0511: FIXME/TODO lines in code
disable=W0511


[REPORTS]

# Set the output format. Available formats are text, parseable, colorized, msvs
# (visual studio) and html. You can also give a reporter class, eg
# mypackage.mymodule.MyReporterClass.
output-format=text

# Put messages in a separate file for each module / package specified on the
# command line instead of printing them on stdout. Reports (if any) will be
# written in a file name "pylint_global.[txt|html]".
files-output=no

# Tells whether to display a full report or only the messages
reports=yes

# Python expression which should return a note less than 10 (10 is the highest
# note). You have access to the variables errors warning, statement which
# respectively contain the number of errors / warnings messages and the total
# number of statements analyzed. This is used by the global evaluation report
# (RP0004).
evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)

# Template used to display messages. This is a python new-style format string
# used to format the message information. See doc for all details
#msg-template=


[SIMILARITIES]

# Minimum lines number of a similarity.
min-similarity-lines=8

# Ignore comments when computing similarities.
ignore-comments=yes

# Ignore docstrings when computing similarities.
ignore-docstrings=yes

# Ignore imports when computing similarities.
ignore-imports=no


[MISCELLANEOUS]

# List of note tags to take in consideration, separated by a comma.
notes=FIXME,XXX,TODO


[BASIC]

# List of builtins function names that should not be used, separated by a comma
bad-functions=map,filter,apply,input

# Regular expression which should only match correct module names
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$

# Regular expression which should only match correct module level names
const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$

# Regular expression which should only match correct class names
class-rgx=[A-Z_][a-zA-Z0-9]+$

# Regular expression which should only match correct function names
function-rgx=[a-z_][a-z0-9_]{2,30}$

# Regular expression which should only match correct method names
method-rgx=[a-z_][a-z0-9_]{2,30}$

# Regular expression which should only match correct instance attribute names
attr-rgx=[a-z_][a-z0-9_]{2,30}$

# Regular expression which should only match correct argument names
argument-rgx=[a-z_][a-z0-9_]{2,30}$

# Regular expression which should only match correct variable names
variable-rgx=[a-z_][a-z0-9_]{2,30}$

# Regular expression which should only match correct attribute names in class
# bodies
class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$

# Regular expression which should only match correct list comprehension /
# generator expression variable names
inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$

# Good variable names which should always be accepted, separated by a comma
good-names=i,j,k,ex,Run,_

# Bad variable names which should always be refused, separated by a comma
bad-names=foo,bar,baz,toto,tutu,tata

# Regular expression which should only match function or class names that do
# not require a docstring.
no-docstring-rgx=__.*__

# Minimum line length for functions/classes that require docstrings, shorter
# ones are exempt.
docstring-min-length=-1


[TYPECHECK]

# Tells whether missing members accessed in mixin class should be ignored. A
# mixin class is detected if its name ends with "mixin" (case insensitive).
ignore-mixin-members=yes

# List of classes names for which member attributes should not be checked
# (useful for classes with attributes dynamically set).
ignored-classes=SQLObject

# List of members which are set dynamically and missed by pylint inference
# system, and so shouldn't trigger E0201 when accessed. Python regular
# expressions are accepted.
generated-members=REQUEST,acl_users,aq_parent


[VARIABLES]

# Tells whether we should check for unused import in __init__ files.
init-import=no

# A regular expression matching the beginning of the name of dummy variables
# (i.e. not used).
dummy-variables-rgx=_$|dummy

# List of additional names supposed to be defined in builtins. Remember that
# you should avoid to define new builtins when possible.
additional-builtins=


[FORMAT]

# Maximum number of characters on a single line.
max-line-length=100

# Regexp for a line that is allowed to be longer than the limit.
ignore-long-lines=^\s*(# )?<?https?://\S+>?$

# Allow the body of an if to be on the same line as the test if there is no
# else.
single-line-if-stmt=no

# List of optional constructs for which whitespace checking is disabled
no-space-check=trailing-comma,dict-separator

# Maximum number of lines in a module
max-module-lines=1000

# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
# tab).
indent-string=' '


[CLASSES]

# List of method names used to declare (i.e. assign) instance attributes.
defining-attr-methods=__init__,__new__,setUp

# List of valid names for the first argument in a class method.
valid-classmethod-first-arg=cls

# List of valid names for the first argument in a metaclass class method.
valid-metaclass-classmethod-first-arg=mcs


[IMPORTS]

# Deprecated modules which should not be used, separated by a comma
deprecated-modules=regsub,TERMIOS,Bastion,rexec

# Create a graph of every (i.e. internal and external) dependencies in the
# given file (report RP0402 must not be disabled)
import-graph=

# Create a graph of external dependencies in the given file (report RP0402 must
# not be disabled)
ext-import-graph=

# Create a graph of internal dependencies in the given file (report RP0402 must
# not be disabled)
int-import-graph=


[DESIGN]

# Maximum number of arguments for function / method
max-args=5

# Argument names that match this expression will be ignored. Default to name
# with leading underscore
ignored-argument-names=_.*

# Maximum number of locals for function / method body
max-locals=15

# Maximum number of return / yield for function / method body
max-returns=6

# Maximum number of branch for function / method body
max-branches=12

# Maximum number of statements in function / method body
max-statements=50

# Maximum number of parents for a class (see R0901).
max-parents=7

# Maximum number of attributes for a class (see R0902).
max-attributes=7

# Minimum number of public methods for a class (see R0903).
min-public-methods=2

# Maximum number of public methods for a class (see R0904).
max-public-methods=20


[EXCEPTIONS]

# Exceptions that will emit a warning when being caught. Defaults to
# "Exception"
overgeneral-exceptions=Exception
68 changes: 48 additions & 20 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,64 @@
---
# Use new container infrastructure to enable caching
sudo: false

# Choose a lightweight base image; we provide our own build tools.
language: c
# Python for easy testing of python version
language: python

# GHC depends on GMP. You can add other dependencies here as well.
matrix:
include:
# Tested and fails: python <= 2.6.x, python <= 3.1.x
# Tested to work but not in this matrix: 3.2.6, 3.3.7
- env: ARGS="python"
python: "2.7"
- env: ARGS="python"
python: "3.4"
- env: ARGS="python"
python: "3.5"
- env: ARGS="python"
python: "3.6"

# The different haskell configurations to test.
# You could also do things like change flags or
# use --stack-yaml to point to a different file.
- env: ARGS=""
python: "2.7"
- env: ARGS="--resolver lts-2"
python: "2.7"
- env: ARGS="--resolver lts-3"
python: "2.7"
- env: ARGS="--resolver lts"
python: "2.7"
- env: ARGS="--resolver nightly"
python: "2.7"

# # GHC depends on GMP. You can add other dependencies here as well.
addons:
apt:
packages:
- libgmp-dev

# The different configurations we want to test. You could also do things like
# change flags or use --stack-yaml to point to a different file.
env:
- ARGS=""
- ARGS="--resolver lts-2"
- ARGS="--resolver lts-3"
- ARGS="--resolver lts"
- ARGS="--resolver nightly"
- libgmp-dev

before_install:
# Download and unpack the stack executable
- mkdir -p ~/.local/bin
- export PATH=$HOME/.local/bin:$PATH
- travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
# Download and unpack the stack executable for haskell, else pip deps.
install:
- if [ "$ARGS" = "python" ]; then
pip install tox;
else
mkdir -p ~/.local/bin;
export PATH=$HOME/.local/bin:$PATH;
travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack';
fi

# This line does all of the work: installs GHC if necessary, build the library,
# executables, and test suites, and runs the test suites. --no-terminal works
# around some quirks in Travis's terminal implementation.
script: stack $ARGS --no-terminal --install-ghc test --haddock
script:
- if [ "$ARGS" = "python" ]; then
tox;
else
stack $ARGS --no-terminal --install-ghc test --haddock;
fi

# Caching so the next build will be fast too.
cache:
directories:
- $HOME/.stack
- $HOME/.stack
Loading