pylint added

develop
Ahmed Aly 2017-11-13 16:38:20 +01:00
parent e241558d14
commit 570f31c908
3 changed files with 29 additions and 0 deletions

2
dev/pylint/pre-commit Executable file
View File

@ -0,0 +1,2 @@
#!/usr/bin/env bash
git-pylint-commit-hook --suppress-report

3
dev/pylint/pylintrc Normal file
View File

@ -0,0 +1,3 @@
[MASTER]
# Specify a configuration file.
rcfile=/home/aaly/gitrepos/dp-int/pylintrc

24
dev/pylint/setup_pylint_hook Executable file
View File

@ -0,0 +1,24 @@
#!/usr/bin/env bash
if python -c "pylint_odoo" &> /dev/null; then
echo 'The pylint module "pylint-odoo" is not installed and is going to be installed now!'
sudo pip install --upgrade git+https://github.com/oca/pylint-odoo.git
else
echo 'The pylint module "pylint-odoo" is already installed. Continue ...'
fi
if python -c "git_pylint_commit_hook" &> /dev/null; then
echo 'git-pylint-commit-hook is not insalled and is going to be isntalled now!'
sudo pip install git-pylint-commit-hook
else
echo 'git-pylint-commit-hook is already installed. Continue ...'
fi
if [ ! -f ~/gitrepos/dp-int/pylintrc ]; then
echo "The pylintrc file can't be found in ~/gitrepos/dp-int/!"
echo "Please clone the git repository dp-int"
fi
cd $(git rev-parse --show-toplevel)
ln -s -f ~/gitrepos/dp-int/pylintrc ~/.pylintrc
ln -s -f $(git rev-parse --show-toplevel)/dev/pylint/pre-commit $(git rev-parse --show-toplevel)/.git/hooks/pre-commit
echo 'pre-commit hook created!'