mirror of
				https://github.com/f-droid/fdroidserver.git
				synced 2025-11-04 06:30:27 +03:00 
			
		
		
		
	make linting and formatting rules consistent
This commit is contained in:
		
							parent
							
								
									acc774f91e
								
							
						
					
					
						commit
						4b898287e9
					
				
					 3 changed files with 25 additions and 22 deletions
				
			
		| 
						 | 
				
			
			@ -52,20 +52,6 @@ else
 | 
			
		|||
    done
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
# We ignore the following PEP8 warnings
 | 
			
		||||
# * E123: closing bracket does not match indentation of opening bracket's line
 | 
			
		||||
#   - Broken if multiple indentation levels start on a single line
 | 
			
		||||
# * E203: whitespace before ':'
 | 
			
		||||
#   - E203 is not PEP 8 compliant and conflict with black
 | 
			
		||||
# * E501: line too long (82 > 79 characters)
 | 
			
		||||
#   - Recommended for readability but not enforced
 | 
			
		||||
#   - Some lines are awkward to wrap around a char limit
 | 
			
		||||
# * W503: line break before binary operator
 | 
			
		||||
#   - Quite pedantic
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
PEP8_IGNORE="E123,E203,E501,W503"
 | 
			
		||||
 | 
			
		||||
err() {
 | 
			
		||||
	echo >&2 ERROR: "$@"
 | 
			
		||||
	exit 1
 | 
			
		||||
| 
						 | 
				
			
			@ -96,7 +82,7 @@ find_command() {
 | 
			
		|||
DASH=$(find_command dash)
 | 
			
		||||
PYDOCSTYLE=$(find_command pydocstyle)
 | 
			
		||||
PYFLAKES=$(find_command pyflakes)
 | 
			
		||||
PEP8=$(find_command pycodestyle pep8)
 | 
			
		||||
PYCODESTYLE=$(find_command pycodestyle pep8)
 | 
			
		||||
RUBY=$(find_command ruby)
 | 
			
		||||
YAMLLINT=$(find_command yamllint)
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -110,16 +96,13 @@ if [ "$PY_FILES $PY_TEST_FILES" != " " ]; then
 | 
			
		|||
fi
 | 
			
		||||
 | 
			
		||||
if [ "$PY_FILES" != "" ]; then
 | 
			
		||||
    if ! $PEP8 --ignore=$PEP8_IGNORE $PY_FILES; then
 | 
			
		||||
    if ! $PYCODESTYLE $PY_FILES; then
 | 
			
		||||
	err "pep8 tests failed!"
 | 
			
		||||
    fi
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
# The tests use a little hack in order to cleanly import the fdroidserver
 | 
			
		||||
# package locally like a regular package.  pep8 doesn't see that, so this
 | 
			
		||||
# makes pep8 skip E402 on the test files that need that hack.
 | 
			
		||||
if [ "$PY_TEST_FILES" != "" ]; then
 | 
			
		||||
    if ! $PEP8 --ignore=$PEP8_IGNORE,E402 $PY_TEST_FILES; then
 | 
			
		||||
    if ! $PYCODESTYLE $PY_TEST_FILES; then
 | 
			
		||||
	err "pep8 tests failed!"
 | 
			
		||||
    fi
 | 
			
		||||
fi
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,3 +1,23 @@
 | 
			
		|||
 | 
			
		||||
# We ignore the following PEP8 warnings
 | 
			
		||||
# * E123: closing bracket does not match indentation of opening bracket's line
 | 
			
		||||
#   - Broken if multiple indentation levels start on a single line
 | 
			
		||||
# * E203: whitespace before ':'
 | 
			
		||||
#   - E203 is not PEP 8 compliant and conflict with black
 | 
			
		||||
# * E402: module level import not at top of file
 | 
			
		||||
#   - The tests use a little hack in order to cleanly import the
 | 
			
		||||
#     fdroidserver package locally like a regular package.  pep8 doesn't
 | 
			
		||||
#     see that, so this makes pep8 skip E402 on the test files that need
 | 
			
		||||
#     that hack.
 | 
			
		||||
# * E501: line too long (82 > 79 characters)
 | 
			
		||||
#   - Recommended for readability but not enforced
 | 
			
		||||
#   - Some lines are awkward to wrap around a char limit
 | 
			
		||||
# * W503: line break before binary operator
 | 
			
		||||
#   - Quite pedantic
 | 
			
		||||
 | 
			
		||||
[tool.autopep8]
 | 
			
		||||
ignore = "E123,E203,E402,E501,W503"
 | 
			
		||||
 | 
			
		||||
[tool.black]
 | 
			
		||||
skip-string-normalization = true
 | 
			
		||||
target-version = ["py38"]
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -40,11 +40,11 @@ domain = fdroidserver
 | 
			
		|||
directory = locale
 | 
			
		||||
 | 
			
		||||
[pycodestyle]
 | 
			
		||||
ignore = E203,W503
 | 
			
		||||
ignore = E123,E203,E402,E501,W503
 | 
			
		||||
max-line-length = 88
 | 
			
		||||
 | 
			
		||||
[flake8]
 | 
			
		||||
ignore = E203,W503
 | 
			
		||||
ignore = E123,E203,E402,E501,W503
 | 
			
		||||
max-line-length = 88
 | 
			
		||||
 | 
			
		||||
# Settings for docstrings linter
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue