diff options
| author | CoprDistGit <infra@openeuler.org> | 2023-04-11 00:19:28 +0000 |
|---|---|---|
| committer | CoprDistGit <infra@openeuler.org> | 2023-04-11 00:19:28 +0000 |
| commit | 327a4f52598647fbccb5db8deab55884bba1620f (patch) | |
| tree | 0b6c1c23ce7f681749e18d2160621eb130048976 | |
| parent | 6d780412f7f8f20d9df497460a382bfa608bfbc4 (diff) | |
automatic import of python-flake8-django
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | python-flake8-django.spec | 292 | ||||
| -rw-r--r-- | sources | 1 |
3 files changed, 294 insertions, 0 deletions
@@ -0,0 +1 @@ +/flake8-django-1.1.5.tar.gz diff --git a/python-flake8-django.spec b/python-flake8-django.spec new file mode 100644 index 0000000..64b4c06 --- /dev/null +++ b/python-flake8-django.spec @@ -0,0 +1,292 @@ +%global _empty_manifest_terminate_build 0 +Name: python-flake8-django +Version: 1.1.5 +Release: 1 +Summary: Plugin to catch bad style specific to Django Projects. +License: GPL-3.0-or-later +URL: https://github.com/rocioar/flake8-django +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/3c/28/34fdde82fc76527b422897dd1d174ea6f8bac85b9ce80be2d2a922851eb7/flake8-django-1.1.5.tar.gz +BuildArch: noarch + +Requires: python3-flake8 + +%description +# flake8-django + +[](https://pypi.python.org/pypi/flake8-django/) +[](https://codecov.io/gh/rocioar/flake8-django) +[](https://pepy.tech/project/flake8-django) + +A flake8 plugin to detect bad practices on Django projects. + +## Installation + +Install from pip with: + +``` +$ pip install flake8-django +``` + +## Testing + +flake8-django uses pytest for tests. To run them use: + +``` +$ pytest +```` + +Run coverage report using: + +``` +$ pytest --cov=. +``` + +## List of Rules + +| Rule | Description | +| ---- | ----------- | +| [`DJ01`](https://github.com/rocioar/flake8-django/wiki/%5BDJ01%5D-Avoid-using-null=True-on-string-based-fields-such-as-CharField-and-TextField) | Avoid using null=True on string-based fields such as CharField and TextField | +| [`DJ03`](https://github.com/rocioar/flake8-django/wiki/%5BDJ03%5D-Avoid-passing-locals()-as-context-to-a-render-function) | Avoid passing locals() as context to a render function | +| [`DJ06`](https://github.com/rocioar/flake8-django/wiki/%5BDJ06%5D-Do-not-use-exclude-with-ModelForm,-use-fields-instead) | Do not use exclude with ModelForm, use fields instead | +| [`DJ07`](https://github.com/rocioar/flake8-django/wiki/%5BDJ07%5D-Do-not-set-fields-to-'__all__'-on-ModelForm,-use-fields-instead) | Do not use `__all__` with ModelForm, use fields instead | +| [`DJ08`](https://github.com/rocioar/flake8-django/wiki/%5BDJ08%5D-Model-does-not-define-__str__-method) | Model does not define `__str__` method | +| [`DJ12`](https://github.com/rocioar/flake8-django/wiki/%5BDJ12%5D-Order-of-Model's-inner-classes,-methods,-and-fields-does-not-follow-the-Django-Style-Guide) | Order of Model's inner classes, methods, and fields does not follow the [Django Style Guide](https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/coding-style/#model-style) | +| [`DJ13`](https://github.com/rocioar/flake8-django/wiki/DJ13---@receiver-decorator-must-be-on-top-of-all-the-other-decorators) | @receiver decorator must be on top of all the other decorators | + +More details about each of the Rules can be found on the [wiki page](https://github.com/rocioar/flake8-django/wiki). + +## Optional Rules - Disabled by Default + +| Rule | Description | +| ---- | ----------- | +| [`DJ10`](https://github.com/rocioar/flake8-django/wiki/%5BDJ10%5D-Model-should-define-verbose_name-on-its-Meta-inner-class) | Model should define verbose_name on its Meta inner class | +| [`DJ11`](https://github.com/rocioar/flake8-django/wiki/%5BDJ11%5D-Model-should-define-verbose_name_plural-on-its-Meta-inner-class) | Model should define verbose_name_plural on its Meta inner class | + +To enable optional rules you can use the `--select` parameter. It's default values are: E,F,W,C90. + +For example, if you wanted to enable `DJ10`, you could call `flake8` in the following way: +``` +flake8 --select=E,F,W,C90,DJ,DJ10 +``` + +You could also add it to your configuration file: +``` +[flake8] +max-line-length = 120 +... +select = C,E,F,W,DJ,DJ10 +``` + +## Licence + +GPL + +## Thanks + +[@stummjr](https://github.com/stummjr) for teaching me AST, and what I could do with it. His [blog](https://stummjr.org/post/building-a-custom-flake8-plugin/) is cool. + + +%package -n python3-flake8-django +Summary: Plugin to catch bad style specific to Django Projects. +Provides: python-flake8-django +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-flake8-django +# flake8-django + +[](https://pypi.python.org/pypi/flake8-django/) +[](https://codecov.io/gh/rocioar/flake8-django) +[](https://pepy.tech/project/flake8-django) + +A flake8 plugin to detect bad practices on Django projects. + +## Installation + +Install from pip with: + +``` +$ pip install flake8-django +``` + +## Testing + +flake8-django uses pytest for tests. To run them use: + +``` +$ pytest +```` + +Run coverage report using: + +``` +$ pytest --cov=. +``` + +## List of Rules + +| Rule | Description | +| ---- | ----------- | +| [`DJ01`](https://github.com/rocioar/flake8-django/wiki/%5BDJ01%5D-Avoid-using-null=True-on-string-based-fields-such-as-CharField-and-TextField) | Avoid using null=True on string-based fields such as CharField and TextField | +| [`DJ03`](https://github.com/rocioar/flake8-django/wiki/%5BDJ03%5D-Avoid-passing-locals()-as-context-to-a-render-function) | Avoid passing locals() as context to a render function | +| [`DJ06`](https://github.com/rocioar/flake8-django/wiki/%5BDJ06%5D-Do-not-use-exclude-with-ModelForm,-use-fields-instead) | Do not use exclude with ModelForm, use fields instead | +| [`DJ07`](https://github.com/rocioar/flake8-django/wiki/%5BDJ07%5D-Do-not-set-fields-to-'__all__'-on-ModelForm,-use-fields-instead) | Do not use `__all__` with ModelForm, use fields instead | +| [`DJ08`](https://github.com/rocioar/flake8-django/wiki/%5BDJ08%5D-Model-does-not-define-__str__-method) | Model does not define `__str__` method | +| [`DJ12`](https://github.com/rocioar/flake8-django/wiki/%5BDJ12%5D-Order-of-Model's-inner-classes,-methods,-and-fields-does-not-follow-the-Django-Style-Guide) | Order of Model's inner classes, methods, and fields does not follow the [Django Style Guide](https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/coding-style/#model-style) | +| [`DJ13`](https://github.com/rocioar/flake8-django/wiki/DJ13---@receiver-decorator-must-be-on-top-of-all-the-other-decorators) | @receiver decorator must be on top of all the other decorators | + +More details about each of the Rules can be found on the [wiki page](https://github.com/rocioar/flake8-django/wiki). + +## Optional Rules - Disabled by Default + +| Rule | Description | +| ---- | ----------- | +| [`DJ10`](https://github.com/rocioar/flake8-django/wiki/%5BDJ10%5D-Model-should-define-verbose_name-on-its-Meta-inner-class) | Model should define verbose_name on its Meta inner class | +| [`DJ11`](https://github.com/rocioar/flake8-django/wiki/%5BDJ11%5D-Model-should-define-verbose_name_plural-on-its-Meta-inner-class) | Model should define verbose_name_plural on its Meta inner class | + +To enable optional rules you can use the `--select` parameter. It's default values are: E,F,W,C90. + +For example, if you wanted to enable `DJ10`, you could call `flake8` in the following way: +``` +flake8 --select=E,F,W,C90,DJ,DJ10 +``` + +You could also add it to your configuration file: +``` +[flake8] +max-line-length = 120 +... +select = C,E,F,W,DJ,DJ10 +``` + +## Licence + +GPL + +## Thanks + +[@stummjr](https://github.com/stummjr) for teaching me AST, and what I could do with it. His [blog](https://stummjr.org/post/building-a-custom-flake8-plugin/) is cool. + + +%package help +Summary: Development documents and examples for flake8-django +Provides: python3-flake8-django-doc +%description help +# flake8-django + +[](https://pypi.python.org/pypi/flake8-django/) +[](https://codecov.io/gh/rocioar/flake8-django) +[](https://pepy.tech/project/flake8-django) + +A flake8 plugin to detect bad practices on Django projects. + +## Installation + +Install from pip with: + +``` +$ pip install flake8-django +``` + +## Testing + +flake8-django uses pytest for tests. To run them use: + +``` +$ pytest +```` + +Run coverage report using: + +``` +$ pytest --cov=. +``` + +## List of Rules + +| Rule | Description | +| ---- | ----------- | +| [`DJ01`](https://github.com/rocioar/flake8-django/wiki/%5BDJ01%5D-Avoid-using-null=True-on-string-based-fields-such-as-CharField-and-TextField) | Avoid using null=True on string-based fields such as CharField and TextField | +| [`DJ03`](https://github.com/rocioar/flake8-django/wiki/%5BDJ03%5D-Avoid-passing-locals()-as-context-to-a-render-function) | Avoid passing locals() as context to a render function | +| [`DJ06`](https://github.com/rocioar/flake8-django/wiki/%5BDJ06%5D-Do-not-use-exclude-with-ModelForm,-use-fields-instead) | Do not use exclude with ModelForm, use fields instead | +| [`DJ07`](https://github.com/rocioar/flake8-django/wiki/%5BDJ07%5D-Do-not-set-fields-to-'__all__'-on-ModelForm,-use-fields-instead) | Do not use `__all__` with ModelForm, use fields instead | +| [`DJ08`](https://github.com/rocioar/flake8-django/wiki/%5BDJ08%5D-Model-does-not-define-__str__-method) | Model does not define `__str__` method | +| [`DJ12`](https://github.com/rocioar/flake8-django/wiki/%5BDJ12%5D-Order-of-Model's-inner-classes,-methods,-and-fields-does-not-follow-the-Django-Style-Guide) | Order of Model's inner classes, methods, and fields does not follow the [Django Style Guide](https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/coding-style/#model-style) | +| [`DJ13`](https://github.com/rocioar/flake8-django/wiki/DJ13---@receiver-decorator-must-be-on-top-of-all-the-other-decorators) | @receiver decorator must be on top of all the other decorators | + +More details about each of the Rules can be found on the [wiki page](https://github.com/rocioar/flake8-django/wiki). + +## Optional Rules - Disabled by Default + +| Rule | Description | +| ---- | ----------- | +| [`DJ10`](https://github.com/rocioar/flake8-django/wiki/%5BDJ10%5D-Model-should-define-verbose_name-on-its-Meta-inner-class) | Model should define verbose_name on its Meta inner class | +| [`DJ11`](https://github.com/rocioar/flake8-django/wiki/%5BDJ11%5D-Model-should-define-verbose_name_plural-on-its-Meta-inner-class) | Model should define verbose_name_plural on its Meta inner class | + +To enable optional rules you can use the `--select` parameter. It's default values are: E,F,W,C90. + +For example, if you wanted to enable `DJ10`, you could call `flake8` in the following way: +``` +flake8 --select=E,F,W,C90,DJ,DJ10 +``` + +You could also add it to your configuration file: +``` +[flake8] +max-line-length = 120 +... +select = C,E,F,W,DJ,DJ10 +``` + +## Licence + +GPL + +## Thanks + +[@stummjr](https://github.com/stummjr) for teaching me AST, and what I could do with it. His [blog](https://stummjr.org/post/building-a-custom-flake8-plugin/) is cool. + + +%prep +%autosetup -n flake8-django-1.1.5 + +%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-django -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Tue Apr 11 2023 Python_Bot <Python_Bot@openeuler.org> - 1.1.5-1 +- Package Spec generated @@ -0,0 +1 @@ +3b8f7479ee87029ac943831a56e32976 flake8-django-1.1.5.tar.gz |
