Skip to content

Instantly share code, notes, and snippets.

View Monal5031's full-sized avatar
🏠
Working from home

Monal Shadi Monal5031

🏠
Working from home
View GitHub Profile
@Monal5031
Monal5031 / guideline.md
Created August 7, 2018 16:40
Python Guidelines for Sysrers Open Source

1. Indentation 1

1.1 Tabs or spaces

Use four spaces per indentation level; as mentioned in pep8.

1.2 Maximum line length

Limit all the lines to a maximum of 80 characters per line The preferred way of wrapping long lines when inside parentheses, brackets and braces are explained below in section 1.3.

@Monal5031
Monal5031 / flake8_errors_log.txt
Created August 6, 2018 05:45
Errors raised after integrating flake8
./job/views.py:10:1: F401 'django.views.generic.ListView' imported but unused
./job/views.py:20:81: E501 line too long (83 > 80 characters)
./job/views.py:21:81: E501 line too long (93 > 80 characters)
./job/views.py:23:1: E302 expected 2 blank lines, found 1
./job/views.py:60:17: W503 line break before binary operator
./job/views.py:144:17: W503 line break before binary operator
./job/views.py:181:81: E501 line too long (84 > 80 characters)
./job/views.py:201:13: E122 continuation line missing indentation or outdented
./job/views.py:202:9: E122 continuation line missing indentation or outdented
./job/views.py:215:81: E501 line too long (101 > 80 characters)
@Monal5031
Monal5031 / setup.cfg
Last active August 3, 2018 15:19
Setup config for Systers python repositories.
[flake8]
# TBD
#ignore =
# Use relative paths for the directories to be ignored.
exclude =
# Ignore git directories
../.git,
# Ignore docs and automated docs
../aut_docs/*, ../docs/*,
# Ignore manage.py
@Monal5031
Monal5031 / rules_to_be_ignored
Last active August 6, 2018 06:06
Flake8 rules to be ignored
W391 blank line at end of file
F841 Local variable name assigned but never be used.
To be discussed:
E123 closing bracket does not match indentation of opening bracket’s line
E124 closing bracket does not match visual indentation
E125 continuation line does not distinguish itself from next logical line
E127 continuation line over-indented for visual indent
E128 continuation line under-indented for visual indent
@Monal5031
Monal5031 / convert_crlf_to_lf.py
Created August 1, 2018 15:18
Python script to convert windows line ending CRLF to Unix LF.
import os
directory_in_str = os.path.dirname(os.path.realpath(__file__))
windows_line_ending = b'\r\n'
linux_line_ending = b'\n'
all_files = []
for root, dirs, files in os.walk(directory_in_str):
for name in files:
@Monal5031
Monal5031 / gist:19ed8e0957b5b353fdda425ff0cd9185
Created February 13, 2018 03:36
Traceback while running tests locally.
Testing started at 9:02 AM ...
/home/fsociety/Desktop/work/forty-two/venv/bin/python /opt/pycharm-2017.3.3/helpers/pycharm/django_test_manage.py test blog.tests /home/fsociety/Desktop/work/forty-two
Creating test database for alias 'default'...
System check identified no issues (0 silenced).
Error
Traceback (most recent call last):
File "/home/fsociety/Desktop/work/forty-two/venv/lib/python3.5/site-packages/django/db/backends/utils.py", line 85, in _execute
return self.cursor.execute(sql, params)
File "/home/fsociety/Desktop/work/forty-two/venv/lib/python3.5/site-packages/django/db/backends/sqlite3/base.py", line 303, in execute