Skip to content

Commit

Permalink
Merge pull request #25 from MarcinOrlowski/dev
Browse files Browse the repository at this point in the history
Release 2.0.0
  • Loading branch information
MarcinOrlowski authored Aug 2, 2021
2 parents 6cca35c + 286be46 commit f14dbe8
Show file tree
Hide file tree
Showing 85 changed files with 4,051 additions and 1,125 deletions.
5 changes: 5 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,8 @@
# https://github.com/MarcinOrlowski/prop-tool/
#
comment: false
coverage:
status:
patch:
default:
enabled: no
198 changes: 97 additions & 101 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -6,109 +6,75 @@
# pip install wemake-python-styleguide
# flake8 proptool/report/
#
# Refactoring hitns:
# Refactoring hints:
# https://flake8.codes/wemake-python-styleguide/0.15.3/index.html

# https://pypi.org/project/flake8-noqa/
noqa-require-code
max-line-length = 132

exclude =
.git,
__pycache__,
# This contains our built documentation
# This contains our built documentation
build,
dist

# it's not a bug that we aren't using all of hacking
ignore =
# WPS211 Found too many arguments: 6 > 5
WPS211,
# WPS317 Found incorrect multi-line parameters
WPS317,
# D205 1 blank line required between summary line and description
D205,
# D400 First line should end with a period
D400,
# RST213 Inline emphasis start-string without end-string.
RST213,
# WPS300 Found local folder import
WPS300,
# I004 isort found an unexpected blank line in imports
I004,
# I001 isort found an import in the wrong position
I001,
# WPS600 Found subclassing a builtin: list
WPS600,
# WPS305 Found `f` string
WPS305,
# D401 First line should be in imperative mood
D401,
# WPS336 Found explicit string concatenation
WPS336,
# D200 One-line docstring should fit on one line with quotes
D200,
# WPS237 Found a too complex `f` string
WPS237,
# WPS302 Found unicode string prefix
WPS302,
# WPS115 Found upper-case constant in a class
WPS115,
# WPS360 Found an unnecessary use of a raw string
WPS360,
# WPS602 Found using `@staticmethod`
WPS602,
# E251 unexpected spaces around keyword / parameter equals
E251,
# I003 isort expected 1 blank line in imports, found
I003,
# WPS615 Found unpythonic getter or setter
WPS615,
# WPS238 Found too many raises in a function: 5 > 3
WPS238,

# WPS420 Found wrong keyword: pass
WPS420,
# WPS604 Found incorrect node inside `class` body
WPS604

# WPS338 Found incorrect order of methods in a class
WPS338,
# D101 Missing docstring in public class
D101,
# D102 Missing docstring in public method
D102,
# D107 Missing docstring in __init__
D107,
# DAR201 Missing "Returns" in Docstring: - return
DAR201,
# WPS210 Found too many local variables: 14 > 5
WPS210,
# WPS231 Found function with too much cognitive complexity: 83 > 12
WPS231,
# WPS232 Found module cognitive complexity that is too high: 27.7 > 8
WPS232,
# WPS221 Found line with high Jones Complexity: 17 > 14
WPS221,
# F821 undefined name 'PropFile'
F821,
# I005 isort found an unexpected missing import
I005,
# E241 multiple spaces after ':'
E241,
# DAR101 Missing parameter(s) in Docstring
DAR101,

# WPS226 Found string constant over-use: " > 3
WPS226,
# WPS220 Found too deep nesting: 28 > 20
WPS220,
# WPS110 Found wrong variable name: item
WPS110,
# WPS605 Found method without arguments
WPS605,

# WPS319 Found bracket in wrong position
# WPS318 Found extra indentation
WPS319, WPS318
D101, # D101 Missing docstring in public class
D102, # D102 Missing docstring in public method
D107, # D107 Missing docstring in __init__
D200, # D200 One-line docstring should fit on one line with quotes
D202, # D202 No blank lines allowed after function docstring
D205, # D205 1 blank line required between summary line and description
D400, # D400 First line should end with a period
D401, # D401 First line should be in imperative mood
DAR101, # DAR101 Missing parameter(s) in Docstring
DAR201, # DAR201 Missing "Returns" in Docstring: - return
DAR401, # DAR401 Missing exception(s) in Raises section: -r TypeError
E241, # E241 multiple spaces after ':'
E251, # E251 unexpected spaces around keyword / parameter equals
F821, # F821 undefined name 'PropFile'
I001, # I001 isort found an import in the wrong position
I003, # I003 isort expected 1 blank line in imports, found
I004, # I004 isort found an unexpected blank line in imports
I005, # I005 isort found an unexpected missing import
RST213, # RST213 Inline emphasis start-string without end-string.
W503, # W503 line break before binary operator
WPS110, # WPS110 Found wrong variable name: item
WPS114, # WPS114 Found underscored number name pattern: val_1
WPS115, # WPS115 Found upper-case constant in a class
WPS201, # WPS201 Found module with too many imports: 13 > 12
WPS204, #WPS204 Found overused expression: config['opening']; used 5 > 4
WPS210, # WPS210 Found too many local variables: 14 > 5
WPS211, # WPS211 Found too many arguments: 6 > 5
WPS213, # WPS213 Found too many expressions: 10 > 9
WPS214, # WPS214 Found too many methods: 9 > 7
WPS220, # WPS220 Found too deep nesting: 28 > 20
WPS221, # WPS221 Found line with high Jones Complexity: 17 > 14
WPS226, # WPS226 Found string constant over-use: " > 3
WPS229, # WPS229 Found too long ``try`` body length: 2 > 1
WPS231, # WPS231 Found function with too much cognitive complexity: 83 > 12
WPS232, # WPS232 Found module cognitive complexity that is too high: 27.7 > 8
WPS237, # WPS237 Found a too complex `f` string
WPS238, # WPS238 Found too many raises in a function: 5 > 3
WPS300, # WPS300 Found local folder import
WPS302, # WPS302 Found unicode string prefix
WPS305, # WPS305 Found `f` string
WPS317, # WPS317 Found incorrect multi-line parameters
WPS318, # WPS318 Found extra indentation
WPS319, # WPS319 Found bracket in wrong position
WPS336, # WPS336 Found explicit string concatenation
WPS338, # WPS338 Found incorrect order of methods in a class
WPS360, # WPS360 Found an unnecessary use of a raw string
WPS420, # WPS420 Found wrong keyword: pass
WPS442, # WPS442 Found outer scope names shadowing:
WPS600, # I001 isort found an import in the wrong position
WPS602, # WPS602 Found using `@staticmethod`
WPS604, # WPS604 Found incorrect node inside `class` body
WPS605, # WPS605 Found method without arguments
WPS615, # WPS615 Found unpythonic getter or setter

per-file-ignores =
# WPS420 Found wrong keyword: pass
Expand All @@ -117,40 +83,70 @@ per-file-ignores =
proptool/report/warn.py: WPS420, WPS604,

# WPS230 Found too many public instance attributes
proptool/config.py: WPS230,

# WPS214 Found too many methods
proptool/config/config.py: WPS230,
# WPS204 Found overused expression: config['opening']; used 5 > 4
# WPS213 Found too many expressions
# WPS301 Found dotted raw import: proptool.checks
# WPS421 Found wrong function call: dir, print
# WPS437 Found protected attribute usage
# WPS529 Found implicit `.get()` dict usage
# WPS609 Found direct magic attribute usage: __setattr__, __getattr__, ...
# WPS433 Found nested import
# WPS425 Found boolean non-keyword argument: True, False
proptool/config/reader.py: WPS609, WPS421, WPS204, WPS529, WPS433,
proptool/config/builder.py: WPS609, WPS301, WPS437, WPS213, WPS425,

# WPS111 Found too short name
# WPS214 Found too many methods
# WPS317 Found incorrect multi-line parameters
# WPS323 Found `%` string formatting
# WPS421 Found wrong function call: print
# WPS437 Found protected attribute usage
# WPS518 Found implicit `enumerate()` call
# WPS323 Found `%` string formatting
proptool/log.py: WPS214, WPS437, WPS111, WPS317, WPS421, WPS518, WPS323,

# WPS201 Found module with too many imports: 13 > 12
# WPS213 Found too many expressions: 13 > 9
# WPS317 Found incorrect multi-line parameters
# W503 line break before binary operator
# WPS323 Found `%` string formatting
proptool/main.py: WPS201, WPS213, WPS317, W503, WPS323,
proptool/main.py: WPS201, WPS213, WPS317, WPS323,

# WPS430 Found nested function: overrider
# S101 Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
# WPS421 Found wrong function call: dir
# WPS430 Found nested function: overrider
proptool/decorators/overrides.py: WPS430, S101, WPS421,

# WPS201 Found module with too many imports: 21 > 12
# WPS230 Found too many public instance attributes
proptool/prop/file.py: WPS201, WPS230,

# WPS421 Found wrong function call: print
# WPS100 Found wrong module name
# WPS421 Found wrong function call: print
proptool/utils.py: WPS421, WPS100,

# S311 Standard pseudo-random generators are not suitable for security/cryptographic purposes.
# WPS323 Found `%` string formatting
# WPS118 Found too long name
# WPS214 Found too many methods
# WPS323 Found `%` string formatting
# WPS432 Found magic number
# WPS609 Found direct magic attribute usage: __abstractmethods__
tests/*: S311, WPS323, WPS214, WPS432, WPS609
tests/*: S311, WPS323, WPS214, WPS432, WPS609, WPS118,

# WPS431 Found nested class: FakeArgs
# WPS437 Found protected attribute usage: _set_on_off_option
tests/report/test_config_builder.py: WPS431, WPS437,

# WPS430 Found nested function: log_abort_side_effect
# S311 Standard pseudo-random generators are not suitable for security/cryptographic purposes.
# N802 function name 'assertTranslation' should be lowercase
tests/prop/test_file.py: WPS430, S311, N802

# WPS230 Found too many public instance attributes: 8 > 6
# WPS414 Found incorrect unpacking target
# WPS425 Found boolean non-keyword argument: True, False
# WPS431 Found nested class: FakeArgs
# WPS437 Found protected attribute usage: _validate
# WPS609 Found direct magic attribute usage: __setattr__
# S311 Standard pseudo-random generators are not suitable for security/cryptographic purposes.
tests/config/test_config_builder.py: WPS437, WPS425, WPS431, WPS230, WPS414, WPS609, S311,

10 changes: 7 additions & 3 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:

env:
OS: ${{ matrix.os }}
PYTHON: '3.7'
PYTHON: '3.8'

steps:
# https://github.com/marketplace/actions/checkout
Expand All @@ -34,13 +34,17 @@ jobs:
- name: "Setup Python"
uses: actions/setup-python@master
with:
python-version: 3.7

python-version: 3.8

- name: "Generate coverage report"
run: |
python -m pip install --upgrade pip
pip install pytest
pip install pytest-cov
echo "****************************************"
python --version
pytest --version
echo "****************************************"
pytest --cov=./ --cov-report=xml
# https://github.com/marketplace/actions/codecov
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/markdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ jobs:
with:
# LICENSE is externally sourced and we're not going to fix it.
exclude: "LICENSE.md"
config_file: .markdownlint.yaml
config_file: .markdownlint.yml

13 changes: 12 additions & 1 deletion .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ on:
jobs:
unittests:
name: "Testing"
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
# os: [ ubuntu-latest, macos-latest, windows-latest ]
os: [ ubuntu-latest ]
python: [3.6, 3.7, 3.8, 3.9]

steps:
# https://github.com/marketplace/actions/checkout
Expand All @@ -33,6 +38,12 @@ jobs:
srcs:
- '**/*.py'
- name: "Setup Python"
if: steps.filter.outputs.srcs == 'true'
uses: actions/setup-python@master
with:
python-version: ${{ matrix.python }}

- name: "Running unit tests..."
if: steps.filter.outputs.srcs == 'true'
run: python -m unittest discover tests
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

# IDEA
.idea/
*.iml

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down Expand Up @@ -109,9 +110,11 @@ celerybeat.pid

# Environments
.env
.venv
/.venv
/.venv*
env/
venv/
/venv/
/venv*/
ENV/
env.bak/
venv.bak/
Expand Down
5 changes: 3 additions & 2 deletions .markdownlint.yaml → .markdownlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ extends: null
MD001: true

# MD002/first-heading-h1/first-header-h1 - First heading should be a top-level heading
MD002:
MD002: false # MOR (this is because we want the tool's description under the logo to be ### and this is first header).
# Heading level
level: 1
# level: 1


# MD003/heading-style/header-style - Heading style
MD003:
Expand Down
Loading

0 comments on commit f14dbe8

Please sign in to comment.