diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | python-flake8-type-ignore.spec | 304 | ||||
-rw-r--r-- | sources | 1 |
3 files changed, 306 insertions, 0 deletions
@@ -0,0 +1 @@ +/flake8-type-ignore-0.1.0.post2.tar.gz diff --git a/python-flake8-type-ignore.spec b/python-flake8-type-ignore.spec new file mode 100644 index 0000000..1f50411 --- /dev/null +++ b/python-flake8-type-ignore.spec @@ -0,0 +1,304 @@ +%global _empty_manifest_terminate_build 0 +Name: python-flake8-type-ignore +Version: 0.1.0.post2 +Release: 1 +Summary: flake8-type-ignore allows you to disallow type: ignore comments in your typed Python code. +License: BSD 3-Clause License +URL: https://gitlab.com/jonafato/flake8-type-ignore/ +Source0: https://mirrors.aliyun.com/pypi/web/packages/0f/f4/1d35202e735075d0c321541a753a0dd24fed166ee4b63c486a47af7e9a6b/flake8-type-ignore-0.1.0.post2.tar.gz +BuildArch: noarch + +Requires: python3-flake8 + +%description +# flake8-type-ignore + +`flake8-type-ignore` allows you to disallow `type: ignore` comments in your +typed Python code. + +## Usage + +When installed into your Python environment running `flake8`, this plugin will +raise errors according to the table below. For example, installing this plugin +will raise `flake8` errors in the following code: + +```python +# This line raises TI100 +x: str = 1 # type: ignore + +# This line raises both TI101 and TI139 +x.y = 2 # type:ignore[attr-defined,misc] + +def print_only_strings(arg: str): + print(arg) + +# This line raises TI104 +print_only_strings(123) +``` + +## Error codes + +| flake8-type-ignore error code | mypy error code | +| ----------------------------- | ---------------------------------------------------- | +| `TI001` | Meta error code for invalid `type: ignore` comments. | +| `TI002` | Meta error code for unknown mypy error codes. | +| `TI100` | Bare `type: ignore` comment | +| `TI101` | `attr-defined` | +| `TI102` | `name-defined` | +| `TI103` | `call-arg` | +| `TI104` | `arg-type` | +| `TI105` | `call-overload` | +| `TI106` | `valid-type` | +| `TI107` | `var-annotated` | +| `TI108` | `override` | +| `TI109` | `return` | +| `TI110` | `return-value` | +| `TI111` | `assignment` | +| `TI112` | `type-arg` | +| `TI113` | `type-var` | +| `TI114` | `union-attr` | +| `TI115` | `index` | +| `TI116` | `operator` | +| `TI117` | `list-item` | +| `TI118` | `dict-item` | +| `TI119` | `typeddict-item` | +| `TI120` | `has-type` | +| `TI121` | `import` | +| `TI122` | `no-redef` | +| `TI123` | `func-returns-value` | +| `TI124` | `abstract` | +| `TI125` | `valid-newtype` | +| `TI126` | `str-format` | +| `TI127` | `str-bytes-safe` | +| `TI128` | `exit-return` | +| `TI129` | `no-untyped-def` | +| `TI130` | `no-untyped-call` | +| `TI131` | `redundant-cast` | +| `TI132` | `comparison-overlap` | +| `TI133` | `no-any-unimported` | +| `TI134` | `no-any-return` | +| `TI135` | `unreachable` | +| `TI136` | `redundant-expr` | +| `TI137` | `name-match` | +| `TI138` | `syntax` | +| `TI139` | `misc` | + +## License + +flake8-type-ignore is available under the BSD 3-Clause license. See the `LICENSE` file for more details. + + + + +%package -n python3-flake8-type-ignore +Summary: flake8-type-ignore allows you to disallow type: ignore comments in your typed Python code. +Provides: python-flake8-type-ignore +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-flake8-type-ignore +# flake8-type-ignore + +`flake8-type-ignore` allows you to disallow `type: ignore` comments in your +typed Python code. + +## Usage + +When installed into your Python environment running `flake8`, this plugin will +raise errors according to the table below. For example, installing this plugin +will raise `flake8` errors in the following code: + +```python +# This line raises TI100 +x: str = 1 # type: ignore + +# This line raises both TI101 and TI139 +x.y = 2 # type:ignore[attr-defined,misc] + +def print_only_strings(arg: str): + print(arg) + +# This line raises TI104 +print_only_strings(123) +``` + +## Error codes + +| flake8-type-ignore error code | mypy error code | +| ----------------------------- | ---------------------------------------------------- | +| `TI001` | Meta error code for invalid `type: ignore` comments. | +| `TI002` | Meta error code for unknown mypy error codes. | +| `TI100` | Bare `type: ignore` comment | +| `TI101` | `attr-defined` | +| `TI102` | `name-defined` | +| `TI103` | `call-arg` | +| `TI104` | `arg-type` | +| `TI105` | `call-overload` | +| `TI106` | `valid-type` | +| `TI107` | `var-annotated` | +| `TI108` | `override` | +| `TI109` | `return` | +| `TI110` | `return-value` | +| `TI111` | `assignment` | +| `TI112` | `type-arg` | +| `TI113` | `type-var` | +| `TI114` | `union-attr` | +| `TI115` | `index` | +| `TI116` | `operator` | +| `TI117` | `list-item` | +| `TI118` | `dict-item` | +| `TI119` | `typeddict-item` | +| `TI120` | `has-type` | +| `TI121` | `import` | +| `TI122` | `no-redef` | +| `TI123` | `func-returns-value` | +| `TI124` | `abstract` | +| `TI125` | `valid-newtype` | +| `TI126` | `str-format` | +| `TI127` | `str-bytes-safe` | +| `TI128` | `exit-return` | +| `TI129` | `no-untyped-def` | +| `TI130` | `no-untyped-call` | +| `TI131` | `redundant-cast` | +| `TI132` | `comparison-overlap` | +| `TI133` | `no-any-unimported` | +| `TI134` | `no-any-return` | +| `TI135` | `unreachable` | +| `TI136` | `redundant-expr` | +| `TI137` | `name-match` | +| `TI138` | `syntax` | +| `TI139` | `misc` | + +## License + +flake8-type-ignore is available under the BSD 3-Clause license. See the `LICENSE` file for more details. + + + + +%package help +Summary: Development documents and examples for flake8-type-ignore +Provides: python3-flake8-type-ignore-doc +%description help +# flake8-type-ignore + +`flake8-type-ignore` allows you to disallow `type: ignore` comments in your +typed Python code. + +## Usage + +When installed into your Python environment running `flake8`, this plugin will +raise errors according to the table below. For example, installing this plugin +will raise `flake8` errors in the following code: + +```python +# This line raises TI100 +x: str = 1 # type: ignore + +# This line raises both TI101 and TI139 +x.y = 2 # type:ignore[attr-defined,misc] + +def print_only_strings(arg: str): + print(arg) + +# This line raises TI104 +print_only_strings(123) +``` + +## Error codes + +| flake8-type-ignore error code | mypy error code | +| ----------------------------- | ---------------------------------------------------- | +| `TI001` | Meta error code for invalid `type: ignore` comments. | +| `TI002` | Meta error code for unknown mypy error codes. | +| `TI100` | Bare `type: ignore` comment | +| `TI101` | `attr-defined` | +| `TI102` | `name-defined` | +| `TI103` | `call-arg` | +| `TI104` | `arg-type` | +| `TI105` | `call-overload` | +| `TI106` | `valid-type` | +| `TI107` | `var-annotated` | +| `TI108` | `override` | +| `TI109` | `return` | +| `TI110` | `return-value` | +| `TI111` | `assignment` | +| `TI112` | `type-arg` | +| `TI113` | `type-var` | +| `TI114` | `union-attr` | +| `TI115` | `index` | +| `TI116` | `operator` | +| `TI117` | `list-item` | +| `TI118` | `dict-item` | +| `TI119` | `typeddict-item` | +| `TI120` | `has-type` | +| `TI121` | `import` | +| `TI122` | `no-redef` | +| `TI123` | `func-returns-value` | +| `TI124` | `abstract` | +| `TI125` | `valid-newtype` | +| `TI126` | `str-format` | +| `TI127` | `str-bytes-safe` | +| `TI128` | `exit-return` | +| `TI129` | `no-untyped-def` | +| `TI130` | `no-untyped-call` | +| `TI131` | `redundant-cast` | +| `TI132` | `comparison-overlap` | +| `TI133` | `no-any-unimported` | +| `TI134` | `no-any-return` | +| `TI135` | `unreachable` | +| `TI136` | `redundant-expr` | +| `TI137` | `name-match` | +| `TI138` | `syntax` | +| `TI139` | `misc` | + +## License + +flake8-type-ignore is available under the BSD 3-Clause license. See the `LICENSE` file for more details. + + + + +%prep +%autosetup -n flake8-type-ignore-0.1.0.post2 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "\"/%h/%f\"\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "\"/%h/%f\"\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "\"/%h/%f\"\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "\"/%h/%f\"\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "\"/%h/%f.gz\"\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-flake8-type-ignore -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Tue Jun 20 2023 Python_Bot <Python_Bot@openeuler.org> - 0.1.0.post2-1 +- Package Spec generated @@ -0,0 +1 @@ +d5bfb51ff9841dc503c7ceafc5b58e1a flake8-type-ignore-0.1.0.post2.tar.gz |