diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..3ff63ad3 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,8 @@ +repos: +- repo: https://gitlab.com/pycqa/flake8 + rev: '3.7.7' + hooks: + - id: flake8 + additional_dependencies: [flake8-docstrings, pep8-naming, flake8-import-order] + + diff --git a/docs/README.md b/docs/README.md index ba7acb3d..cf45a8b8 100644 --- a/docs/README.md +++ b/docs/README.md @@ -5,11 +5,11 @@ Blog and management platform for PSF for running GSoC ## Installation Requires python 3.6+ +To install development dependncies:- ```bash pip install -r requirements.txt ``` - ## Usage ```python @@ -54,6 +54,11 @@ You can create a virtualenv using the following command: $ virtualenv my_name After running this command, a directory named my_name will be created. This is the directory which contains all the necessary executables to use the packages that a Python project would need. This is where Python packages will be installed. +Now after creating virtual environment, you need to activate it. Remember to activate the relevant virtual environment every time you work on the project. This can be done using the following command:- + +$ source virtualenv_name/bin/activate + +Once the virtual environment is activated, the name of your virtual environment will appear on left side of terminal. This will let you know that the virtual environment is currently active. Now you can install dependencies related to the project in this virtual environment. For example if you are using Django 1.9 for a project, you can install it like you install other packages. (virtualenv_name)$ pip install Django==1.9 diff --git a/requirements.txt b/requirements.txt index 74de513f..52128903 100644 --- a/requirements.txt +++ b/requirements.txt @@ -22,3 +22,4 @@ fredirc==0.3.0 pdfminer.six==20181108 chardet==3.0.4 phonenumbers==8.10.6 +pre-commit>=1.14.4 diff --git a/tox.ini b/tox.ini new file mode 100644 index 00000000..6b44b3c0 --- /dev/null +++ b/tox.ini @@ -0,0 +1,20 @@ +[flake8] +max-line-length = 110 +exclude = +# No need to traverse our git directory +.git, +#Contains mostly auto generated files +*/migrations/*, +*/static/CACHE/*, +#Contains documentation for the project +docs +count = True +format=pylint +hang-closing = True +show-source = True +statistics = True +output-file = output.txt +tee = True +#Enable PyFlakes syntax checking of doctests in docstrings +doctests = True +