summaryrefslogtreecommitdiff
path: root/python-flake8-noqa.spec
blob: 0cbc5d4cf708fd5130638579bd66efc5c80f6510 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
%global _empty_manifest_terminate_build 0
Name:		python-flake8-noqa
Version:	1.3.1
Release:	1
Summary:	Flake8 noqa comment validation
License:	GNU Lesser General Public License v3
URL:		https://pypi.org/project/flake8-noqa/
Source0:	https://mirrors.nju.edu.cn/pypi/web/packages/4f/ac/5d1cd77a8b115e0d97c3ae2b3f2c21174b9feb6740ba43b99e1f11c93e92/flake8-noqa-1.3.1.tar.gz
BuildArch:	noarch

Requires:	python3-flake8
Requires:	python3-typing-extensions
Requires:	python3-importlib-metadata
Requires:	python3-mypy
Requires:	python3-flake8
Requires:	python3-flake8-annotations
Requires:	python3-flake8-bandit
Requires:	python3-flake8-bugbear
Requires:	python3-flake8-commas
Requires:	python3-flake8-comprehensions
Requires:	python3-flake8-continuation
Requires:	python3-flake8-datetimez
Requires:	python3-flake8-docstrings
Requires:	python3-flake8-import-order
Requires:	python3-flake8-literal
Requires:	python3-flake8-noqa
Requires:	python3-flake8-polyfill
Requires:	python3-flake8-pyproject
Requires:	python3-flake8-modern-annotations
Requires:	python3-flake8-requirements
Requires:	python3-flake8-typechecking-import
Requires:	python3-flake8-use-fstring
Requires:	python3-pep8-naming
Requires:	python3-flake8-docstrings

%description
flake8 plugin to validate `# noqa` comments.
flake8 is very particular about formatting of `# noqa` comments.
If your `# noqa` isn't exactly what flake8 expects,
it can easily cause your `# noqa` comment to be ignored.
However, forgetting a colon or adding an extra space in the wrong place
will turn a strict `# noqa: <code>` comment
into a blanket `# noqa` comment,
which is likely not what you intended.
For example:
`# noqa F841`,
`# noqa : F841`,
and `# noqa:  F841`
will be interpreted as `# noqa`
and may, as a result,
hide other errors you care about.
This plugin looks for noqa comments
that do not match the proper formatting
so your `# noqa` comments work and do only what you expect them to.
Optionally, it can also enforce usage of codes with all `# noqa` comments.
In addition, this plugin looks for `# noqa` comments that are unnecessary
because either there are no matching violations on the line
or they contain codes that do not match existing violations.
Errors reported by this module cannot be prevented via `# noqa` comments,
otherwise you'd never see many of the errors it produces.
Use `ignore`, `extend-ignore`, or `per-file-ignores` to ignore them as needed.
Alternatively, if you have a comment that this plugin thinks is a
`# noqa` with codes,
but isn't,
e.g. `# noqa : X100 is not a code`,
you can make the comment look less like a proper `# noqa` comment.
e.g. `# noqa - X100 is not a code`
(flake8 will interpret both of those as `# noqa`).
Usage Note:
When determining if violations have matched a `# noqa` comment,
this plugin requires flake8 to have been made aware of the violations
that would otherwise apply.
Some plugins do their own processing of `# noqa` comments 
and stop sending violation reports to flake8 when they see a `# noqa` comment.
A plugin doing so will cause this plugin to stop seeing the violation,
and it may report the lack of a violation or matching code.
When you then remove the `# noqa` comment or violation code, 
the other plugin will resume sending the violation,
prompting you to restore the `# noqa` comment or code.
The best fix for this situation is to try to get the offending plugin
to stop respecting `# noqa` comments.
A plugin doing so is considered an anti-pattern,
and it's best to allow flake8 to determine if violations should be 
surfaced to the user or not.
The offending plugin may have an option to control this behavior
(note the flake8 `--disable-noqa` option will disable *all* noqa comments,
so is not a suitable fix for this situation).
If the plugin does not have an option to control its `# noqa` behavior, 
the best course of action may be to contact the maintainers of 
the plugin via the appropriate issue reporting system.
If the plugin is unmaintained,
or the maintainers decline to address the issue for whatever reason,
feel free to file an issue on this plugin
to see if a work-around can be established.

%package -n python3-flake8-noqa
Summary:	Flake8 noqa comment validation
Provides:	python-flake8-noqa
BuildRequires:	python3-devel
BuildRequires:	python3-setuptools
BuildRequires:	python3-pip
%description -n python3-flake8-noqa
flake8 plugin to validate `# noqa` comments.
flake8 is very particular about formatting of `# noqa` comments.
If your `# noqa` isn't exactly what flake8 expects,
it can easily cause your `# noqa` comment to be ignored.
However, forgetting a colon or adding an extra space in the wrong place
will turn a strict `# noqa: <code>` comment
into a blanket `# noqa` comment,
which is likely not what you intended.
For example:
`# noqa F841`,
`# noqa : F841`,
and `# noqa:  F841`
will be interpreted as `# noqa`
and may, as a result,
hide other errors you care about.
This plugin looks for noqa comments
that do not match the proper formatting
so your `# noqa` comments work and do only what you expect them to.
Optionally, it can also enforce usage of codes with all `# noqa` comments.
In addition, this plugin looks for `# noqa` comments that are unnecessary
because either there are no matching violations on the line
or they contain codes that do not match existing violations.
Errors reported by this module cannot be prevented via `# noqa` comments,
otherwise you'd never see many of the errors it produces.
Use `ignore`, `extend-ignore`, or `per-file-ignores` to ignore them as needed.
Alternatively, if you have a comment that this plugin thinks is a
`# noqa` with codes,
but isn't,
e.g. `# noqa : X100 is not a code`,
you can make the comment look less like a proper `# noqa` comment.
e.g. `# noqa - X100 is not a code`
(flake8 will interpret both of those as `# noqa`).
Usage Note:
When determining if violations have matched a `# noqa` comment,
this plugin requires flake8 to have been made aware of the violations
that would otherwise apply.
Some plugins do their own processing of `# noqa` comments 
and stop sending violation reports to flake8 when they see a `# noqa` comment.
A plugin doing so will cause this plugin to stop seeing the violation,
and it may report the lack of a violation or matching code.
When you then remove the `# noqa` comment or violation code, 
the other plugin will resume sending the violation,
prompting you to restore the `# noqa` comment or code.
The best fix for this situation is to try to get the offending plugin
to stop respecting `# noqa` comments.
A plugin doing so is considered an anti-pattern,
and it's best to allow flake8 to determine if violations should be 
surfaced to the user or not.
The offending plugin may have an option to control this behavior
(note the flake8 `--disable-noqa` option will disable *all* noqa comments,
so is not a suitable fix for this situation).
If the plugin does not have an option to control its `# noqa` behavior, 
the best course of action may be to contact the maintainers of 
the plugin via the appropriate issue reporting system.
If the plugin is unmaintained,
or the maintainers decline to address the issue for whatever reason,
feel free to file an issue on this plugin
to see if a work-around can be established.

%package help
Summary:	Development documents and examples for flake8-noqa
Provides:	python3-flake8-noqa-doc
%description help
flake8 plugin to validate `# noqa` comments.
flake8 is very particular about formatting of `# noqa` comments.
If your `# noqa` isn't exactly what flake8 expects,
it can easily cause your `# noqa` comment to be ignored.
However, forgetting a colon or adding an extra space in the wrong place
will turn a strict `# noqa: <code>` comment
into a blanket `# noqa` comment,
which is likely not what you intended.
For example:
`# noqa F841`,
`# noqa : F841`,
and `# noqa:  F841`
will be interpreted as `# noqa`
and may, as a result,
hide other errors you care about.
This plugin looks for noqa comments
that do not match the proper formatting
so your `# noqa` comments work and do only what you expect them to.
Optionally, it can also enforce usage of codes with all `# noqa` comments.
In addition, this plugin looks for `# noqa` comments that are unnecessary
because either there are no matching violations on the line
or they contain codes that do not match existing violations.
Errors reported by this module cannot be prevented via `# noqa` comments,
otherwise you'd never see many of the errors it produces.
Use `ignore`, `extend-ignore`, or `per-file-ignores` to ignore them as needed.
Alternatively, if you have a comment that this plugin thinks is a
`# noqa` with codes,
but isn't,
e.g. `# noqa : X100 is not a code`,
you can make the comment look less like a proper `# noqa` comment.
e.g. `# noqa - X100 is not a code`
(flake8 will interpret both of those as `# noqa`).
Usage Note:
When determining if violations have matched a `# noqa` comment,
this plugin requires flake8 to have been made aware of the violations
that would otherwise apply.
Some plugins do their own processing of `# noqa` comments 
and stop sending violation reports to flake8 when they see a `# noqa` comment.
A plugin doing so will cause this plugin to stop seeing the violation,
and it may report the lack of a violation or matching code.
When you then remove the `# noqa` comment or violation code, 
the other plugin will resume sending the violation,
prompting you to restore the `# noqa` comment or code.
The best fix for this situation is to try to get the offending plugin
to stop respecting `# noqa` comments.
A plugin doing so is considered an anti-pattern,
and it's best to allow flake8 to determine if violations should be 
surfaced to the user or not.
The offending plugin may have an option to control this behavior
(note the flake8 `--disable-noqa` option will disable *all* noqa comments,
so is not a suitable fix for this situation).
If the plugin does not have an option to control its `# noqa` behavior, 
the best course of action may be to contact the maintainers of 
the plugin via the appropriate issue reporting system.
If the plugin is unmaintained,
or the maintainers decline to address the issue for whatever reason,
feel free to file an issue on this plugin
to see if a work-around can be established.

%prep
%autosetup -n flake8-noqa-1.3.1

%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-noqa -f filelist.lst
%dir %{python3_sitelib}/*

%files help -f doclist.lst
%{_docdir}/*

%changelog
* Sun Apr 23 2023 Python_Bot <Python_Bot@openeuler.org> - 1.3.1-1
- Package Spec generated