summaryrefslogtreecommitdiff
path: root/python-firehose.spec
blob: 87df6062f1c5fea83a774a46cd7093400c975014 (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
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
%global _empty_manifest_terminate_build 0
Name:		python-firehose
Version:	0.5
Release:	1
Summary:	Library for working with output from static code analyzers
License:	LGPL2.1 or later
URL:		https://github.com/fedora-static-analysis/firehose
Source0:	https://mirrors.nju.edu.cn/pypi/web/packages/9f/85/3a3e436ea1a5f955dc3c6928d14581ade503c0733d1c77b0688c12a83f0b/firehose-0.5.tar.gz
BuildArch:	noarch


%description
"firehose" is a Python package intended for managing the results from
code analysis tools (e.g. compiler warnings, static analysis, linters,
etc).

It currently provides parsers for the output of gcc, clang-analyzer, cppcheck,
and findbugs.  These parsers convert the results into a common data model of
Python objects, with methods for lossless roundtrips through a provided
XML format.  There is also a JSON equivalent.

It is available on pypi here:
  https://pypi.python.org/pypi/firehose

and via git from:
  https://github.com/fedora-static-analysis/firehose

The mailing list is:
  https://admin.fedoraproject.org/mailman/listinfo/firehose-devel
  
Documentation can be read here:
  http://firehose.readthedocs.io/en/latest/

Firehose is Free Software, licensed under the LGPLv2.1 or (at your
option) any later version.

It requires Python 2.7 or 3.2 onwards, and has been successfully tested
with PyPy.

It is currently of alpha quality.

The API and serialization formats are not yet set in stone (and we're
keen on hearing feedback before we lock things down more).

Motivation: http://lists.fedoraproject.org/pipermail/devel/2012-December/175232.html

I want to slurp the results from static code analysis into a database,
which means coercing all of the results into some common interchange format,
codenamed "firehose" (which could also be the name of the database).

The idea is a common XML format that all tools can emit that:
  * describes a warning
  * gives source-code location of the warning: filename, function,
    line number.
  * optionally with a `CWE <http://cwe.mitre.org/about/index.html>`_
    identifier
  * potentially with other IDs and URLs, e.g. the ID "SIG30-C" with URL
    https://www.securecoding.cert.org/confluence/display/seccode/SIG30-C.+Call+only+asynchronous-safe+functions+within+signal+handlers
  * optionally describes code path to get there (potentially
    interprocedural across source files), potentially with "state"
    annotations (e.g. in the case of a reference-counting bug, it's useful
    to be able to annotate the changes to the refcount).

together with a simple Python API for working with the format as a
collection of Python objects (creating, write to XML, read from XML,
modification, etc)

I initially considered using JSON, but went with XML because if multiple
tools are going to emit this, it's good to be able to validate things
against a schema (see
`firehose.rng <https://github.com/fedora-static-analysis/firehose/blob/master/firehose.rng>`_,
a RELAX-NG schema).

References to source files in the format can include a hash of the source
file itself (e.g. SHA-1) so that you can uniquely identify which source file
you were talking about.

This format would be slurped into the DB for the web UI, and can have other
things done to it without needing a server:
e.g.:

  * convert it to the textual form of a gcc compilation error, so that
    Emacs etc can parse it and take you to the source
  * be turned into a simple HTML report locally on your workstation

Projects using Firehose:

  * `mock-with-analysis <https://github.com/fedora-static-analysis/mock-with-analysis>`_
    can rebuild a source RPM, capturing the results of 4 different code
    analysis tools in Firehose format (along with all source files that
    were mentioned in any report).
  * The `"firehose" branch
    <http://git.fedorahosted.org/cgit/gcc-python-plugin.git/log/?h=firehose>`_
    of
    `cpychecker <https://gcc-python-plugin.readthedocs.org/en/latest/cpychecker.html>`_
    can natively emit Firehose XML reports
  * https://github.com/paultag/storz/blob/master/wrappers/storz-lintian


%package -n python3-firehose
Summary:	Library for working with output from static code analyzers
Provides:	python-firehose
BuildRequires:	python3-devel
BuildRequires:	python3-setuptools
BuildRequires:	python3-pip
%description -n python3-firehose
"firehose" is a Python package intended for managing the results from
code analysis tools (e.g. compiler warnings, static analysis, linters,
etc).

It currently provides parsers for the output of gcc, clang-analyzer, cppcheck,
and findbugs.  These parsers convert the results into a common data model of
Python objects, with methods for lossless roundtrips through a provided
XML format.  There is also a JSON equivalent.

It is available on pypi here:
  https://pypi.python.org/pypi/firehose

and via git from:
  https://github.com/fedora-static-analysis/firehose

The mailing list is:
  https://admin.fedoraproject.org/mailman/listinfo/firehose-devel
  
Documentation can be read here:
  http://firehose.readthedocs.io/en/latest/

Firehose is Free Software, licensed under the LGPLv2.1 or (at your
option) any later version.

It requires Python 2.7 or 3.2 onwards, and has been successfully tested
with PyPy.

It is currently of alpha quality.

The API and serialization formats are not yet set in stone (and we're
keen on hearing feedback before we lock things down more).

Motivation: http://lists.fedoraproject.org/pipermail/devel/2012-December/175232.html

I want to slurp the results from static code analysis into a database,
which means coercing all of the results into some common interchange format,
codenamed "firehose" (which could also be the name of the database).

The idea is a common XML format that all tools can emit that:
  * describes a warning
  * gives source-code location of the warning: filename, function,
    line number.
  * optionally with a `CWE <http://cwe.mitre.org/about/index.html>`_
    identifier
  * potentially with other IDs and URLs, e.g. the ID "SIG30-C" with URL
    https://www.securecoding.cert.org/confluence/display/seccode/SIG30-C.+Call+only+asynchronous-safe+functions+within+signal+handlers
  * optionally describes code path to get there (potentially
    interprocedural across source files), potentially with "state"
    annotations (e.g. in the case of a reference-counting bug, it's useful
    to be able to annotate the changes to the refcount).

together with a simple Python API for working with the format as a
collection of Python objects (creating, write to XML, read from XML,
modification, etc)

I initially considered using JSON, but went with XML because if multiple
tools are going to emit this, it's good to be able to validate things
against a schema (see
`firehose.rng <https://github.com/fedora-static-analysis/firehose/blob/master/firehose.rng>`_,
a RELAX-NG schema).

References to source files in the format can include a hash of the source
file itself (e.g. SHA-1) so that you can uniquely identify which source file
you were talking about.

This format would be slurped into the DB for the web UI, and can have other
things done to it without needing a server:
e.g.:

  * convert it to the textual form of a gcc compilation error, so that
    Emacs etc can parse it and take you to the source
  * be turned into a simple HTML report locally on your workstation

Projects using Firehose:

  * `mock-with-analysis <https://github.com/fedora-static-analysis/mock-with-analysis>`_
    can rebuild a source RPM, capturing the results of 4 different code
    analysis tools in Firehose format (along with all source files that
    were mentioned in any report).
  * The `"firehose" branch
    <http://git.fedorahosted.org/cgit/gcc-python-plugin.git/log/?h=firehose>`_
    of
    `cpychecker <https://gcc-python-plugin.readthedocs.org/en/latest/cpychecker.html>`_
    can natively emit Firehose XML reports
  * https://github.com/paultag/storz/blob/master/wrappers/storz-lintian


%package help
Summary:	Development documents and examples for firehose
Provides:	python3-firehose-doc
%description help
"firehose" is a Python package intended for managing the results from
code analysis tools (e.g. compiler warnings, static analysis, linters,
etc).

It currently provides parsers for the output of gcc, clang-analyzer, cppcheck,
and findbugs.  These parsers convert the results into a common data model of
Python objects, with methods for lossless roundtrips through a provided
XML format.  There is also a JSON equivalent.

It is available on pypi here:
  https://pypi.python.org/pypi/firehose

and via git from:
  https://github.com/fedora-static-analysis/firehose

The mailing list is:
  https://admin.fedoraproject.org/mailman/listinfo/firehose-devel
  
Documentation can be read here:
  http://firehose.readthedocs.io/en/latest/

Firehose is Free Software, licensed under the LGPLv2.1 or (at your
option) any later version.

It requires Python 2.7 or 3.2 onwards, and has been successfully tested
with PyPy.

It is currently of alpha quality.

The API and serialization formats are not yet set in stone (and we're
keen on hearing feedback before we lock things down more).

Motivation: http://lists.fedoraproject.org/pipermail/devel/2012-December/175232.html

I want to slurp the results from static code analysis into a database,
which means coercing all of the results into some common interchange format,
codenamed "firehose" (which could also be the name of the database).

The idea is a common XML format that all tools can emit that:
  * describes a warning
  * gives source-code location of the warning: filename, function,
    line number.
  * optionally with a `CWE <http://cwe.mitre.org/about/index.html>`_
    identifier
  * potentially with other IDs and URLs, e.g. the ID "SIG30-C" with URL
    https://www.securecoding.cert.org/confluence/display/seccode/SIG30-C.+Call+only+asynchronous-safe+functions+within+signal+handlers
  * optionally describes code path to get there (potentially
    interprocedural across source files), potentially with "state"
    annotations (e.g. in the case of a reference-counting bug, it's useful
    to be able to annotate the changes to the refcount).

together with a simple Python API for working with the format as a
collection of Python objects (creating, write to XML, read from XML,
modification, etc)

I initially considered using JSON, but went with XML because if multiple
tools are going to emit this, it's good to be able to validate things
against a schema (see
`firehose.rng <https://github.com/fedora-static-analysis/firehose/blob/master/firehose.rng>`_,
a RELAX-NG schema).

References to source files in the format can include a hash of the source
file itself (e.g. SHA-1) so that you can uniquely identify which source file
you were talking about.

This format would be slurped into the DB for the web UI, and can have other
things done to it without needing a server:
e.g.:

  * convert it to the textual form of a gcc compilation error, so that
    Emacs etc can parse it and take you to the source
  * be turned into a simple HTML report locally on your workstation

Projects using Firehose:

  * `mock-with-analysis <https://github.com/fedora-static-analysis/mock-with-analysis>`_
    can rebuild a source RPM, capturing the results of 4 different code
    analysis tools in Firehose format (along with all source files that
    were mentioned in any report).
  * The `"firehose" branch
    <http://git.fedorahosted.org/cgit/gcc-python-plugin.git/log/?h=firehose>`_
    of
    `cpychecker <https://gcc-python-plugin.readthedocs.org/en/latest/cpychecker.html>`_
    can natively emit Firehose XML reports
  * https://github.com/paultag/storz/blob/master/wrappers/storz-lintian


%prep
%autosetup -n firehose-0.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-firehose -f filelist.lst
%dir %{python3_sitelib}/*

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

%changelog
* Fri Apr 21 2023 Python_Bot <Python_Bot@openeuler.org> - 0.5-1
- Package Spec generated