forked from click-contrib/click_params
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: formatted code using black and isort I also updated packages * docs: enhanced documentation used some mkdocs-material features to enhance documentation * docs: removed ChoiceListParamType from documentation Since I found an issue with this custom type it is neither imported at the top-level __init__.py file nor documented since I commented that part * ci: added a safety step in the ci.yml file Installed package "safety" and added it in the noxfile.py and the ci configuration file * docs: updated CHANGELOG.md * docs: updated CONTRIBUTING.md and README.md README.md: added a "black" code style label
- Loading branch information
Showing
37 changed files
with
1,345 additions
and
918 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
coverage: | ||
range: "90...100" | ||
round: nearest | ||
precision: 0 | ||
precision: 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,4 +14,4 @@ __pycache__ | |
# packaging / distribution | ||
site | ||
dist | ||
build | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.1.0 | ||
hooks: | ||
- id: check-yaml | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- repo: local | ||
hooks: | ||
- id: isort | ||
name: isort | ||
entry: poetry run isort click_params tests | ||
language: system | ||
types: | ||
- python | ||
- id: black | ||
name: black | ||
entry: poetry run black click_params tests | ||
language: system | ||
types: | ||
- python | ||
- id: bandit | ||
name: bandit | ||
entry: poetry run bandit -r click_params | ||
language: system | ||
exclude: ^tests/ | ||
types: | ||
- python | ||
- id: flake8 | ||
name: flake8 | ||
entry: poetry run flake8 | ||
language: system | ||
types: | ||
- python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ mkdocs: | |
|
||
python: | ||
install: | ||
- requirements: docs/requirements.txt | ||
- requirements: docs/requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,113 @@ | ||
__version__ = '0.2.0' | ||
|
||
from .base import BaseParamType, ValidatorParamType, RangeParamType, ListParamType | ||
from .base import BaseParamType, ListParamType, RangeParamType, ValidatorParamType | ||
from .domain import ( | ||
DOMAIN, PUBLIC_URL, URL, EMAIL, SLUG, EmailParamType, DomainListParamType, PublicUrlListParamType, | ||
UrlListParamType, EmailListParamType, SlugListParamType | ||
DOMAIN, | ||
EMAIL, | ||
PUBLIC_URL, | ||
SLUG, | ||
URL, | ||
DomainListParamType, | ||
EmailListParamType, | ||
EmailParamType, | ||
PublicUrlListParamType, | ||
SlugListParamType, | ||
UrlListParamType, | ||
) | ||
from .miscellaneous import ( | ||
JSON, MAC_ADDRESS, StringListParamType, ChoiceListParamType, MacAddressListParamType, UUIDListParamType, | ||
DateTimeListParamType, FirstOf | ||
from .miscellaneous import ( # ChoiceListParamType, | ||
JSON, | ||
MAC_ADDRESS, | ||
DateTimeListParamType, | ||
FirstOf, | ||
MacAddressListParamType, | ||
StringListParamType, | ||
UUIDListParamType, | ||
) | ||
from .network import ( | ||
IP_ADDRESS, IPV4_ADDRESS, IPV6_ADDRESS, IP_NETWORK, IPV4_NETWORK, IPV6_NETWORK, Ipv4AddressRange, Ipv6AddressRange, | ||
IpAddressListParamType, Ipv4AddressListParamType, Ipv6AddressListParamType, IpNetworkListParamType, | ||
Ipv4NetworkListParamType, Ipv6NetworkListParamType | ||
IP_ADDRESS, | ||
IP_NETWORK, | ||
IPV4_ADDRESS, | ||
IPV4_NETWORK, | ||
IPV6_ADDRESS, | ||
IPV6_NETWORK, | ||
IpAddressListParamType, | ||
IpNetworkListParamType, | ||
Ipv4AddressListParamType, | ||
Ipv4AddressRange, | ||
Ipv4NetworkListParamType, | ||
Ipv6AddressListParamType, | ||
Ipv6AddressRange, | ||
Ipv6NetworkListParamType, | ||
) | ||
from .numeric import ( | ||
COMPLEX, FRACTION, DECIMAL, DecimalRange, FractionRange, IntListParamType, FloatListParamType, | ||
FractionListParamType, DecimalListParamType, ComplexListParamType | ||
COMPLEX, | ||
DECIMAL, | ||
FRACTION, | ||
ComplexListParamType, | ||
DecimalListParamType, | ||
DecimalRange, | ||
FloatListParamType, | ||
FractionListParamType, | ||
FractionRange, | ||
IntListParamType, | ||
) | ||
from .test_utils import assert_list_in_output, assert_equals_output, assert_in_output | ||
from .test_utils import assert_equals_output, assert_in_output, assert_list_in_output | ||
|
||
__all__ = [ | ||
# base | ||
'BaseParamType', 'ValidatorParamType', 'RangeParamType', 'ListParamType', | ||
|
||
'BaseParamType', | ||
'ValidatorParamType', | ||
'RangeParamType', | ||
'ListParamType', | ||
# domain | ||
'DOMAIN', 'PUBLIC_URL', 'URL', 'EmailParamType', 'EMAIL', 'SLUG', 'DomainListParamType', 'PublicUrlListParamType', | ||
'UrlListParamType', 'EmailListParamType', 'SlugListParamType', | ||
|
||
'DOMAIN', | ||
'PUBLIC_URL', | ||
'URL', | ||
'EmailParamType', | ||
'EMAIL', | ||
'SLUG', | ||
'DomainListParamType', | ||
'PublicUrlListParamType', | ||
'UrlListParamType', | ||
'EmailListParamType', | ||
'SlugListParamType', | ||
# miscellaneous | ||
'JSON', 'MAC_ADDRESS', 'ChoiceListParamType', 'StringListParamType', 'MacAddressListParamType', 'UUIDListParamType', | ||
'DateTimeListParamType', 'FirstOf', | ||
|
||
'JSON', | ||
'MAC_ADDRESS', | ||
# 'ChoiceListParamType', | ||
'StringListParamType', | ||
'MacAddressListParamType', | ||
'UUIDListParamType', | ||
'DateTimeListParamType', | ||
'FirstOf', | ||
# network | ||
'IP_ADDRESS', 'IPV6_ADDRESS', 'IPV4_ADDRESS', 'IP_NETWORK', 'IPV4_NETWORK', 'IPV6_NETWORK', 'Ipv4AddressRange', | ||
'Ipv6AddressRange', 'IpAddressListParamType', 'Ipv4AddressListParamType', 'Ipv6AddressListParamType', | ||
'Ipv4NetworkListParamType', 'IpNetworkListParamType', 'Ipv6NetworkListParamType', | ||
|
||
'IP_ADDRESS', | ||
'IPV6_ADDRESS', | ||
'IPV4_ADDRESS', | ||
'IP_NETWORK', | ||
'IPV4_NETWORK', | ||
'IPV6_NETWORK', | ||
'Ipv4AddressRange', | ||
'Ipv6AddressRange', | ||
'IpAddressListParamType', | ||
'Ipv4AddressListParamType', | ||
'Ipv6AddressListParamType', | ||
'Ipv4NetworkListParamType', | ||
'IpNetworkListParamType', | ||
'Ipv6NetworkListParamType', | ||
# numeric | ||
'FRACTION', 'FractionRange', 'DECIMAL', 'DecimalRange', 'COMPLEX', 'IntListParamType', 'FloatListParamType', | ||
'FractionListParamType', 'DecimalListParamType', 'ComplexListParamType', | ||
|
||
'FRACTION', | ||
'FractionRange', | ||
'DECIMAL', | ||
'DecimalRange', | ||
'COMPLEX', | ||
'IntListParamType', | ||
'FloatListParamType', | ||
'FractionListParamType', | ||
'DecimalListParamType', | ||
'ComplexListParamType', | ||
# test_utils | ||
'assert_equals_output', 'assert_in_output', 'assert_list_in_output' | ||
'assert_equals_output', | ||
'assert_in_output', | ||
'assert_list_in_output', | ||
] |
Oops, something went wrong.