File tree 10 files changed +92
-0
lines changed
10 files changed +92
-0
lines changed Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env python
2
+
3
+ # This Source Code Form is subject to the terms of the Mozilla Public
4
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ # file, you can obtain one at http://mozilla.org/MPL/2.0/.
6
+
7
+ import os
8
+ import itertools
9
+ import subprocess
10
+
11
+
12
+ def run ():
13
+
14
+ exceptions = (
15
+ 'docs/conf.py' ,
16
+ 'tests/blockade.py' ,
17
+ 'setup.py' ,
18
+ )
19
+
20
+ alreadies = subprocess .check_output ([
21
+ 'git' , 'grep' ,
22
+ 'This Source Code Form is subject to the terms of the Mozilla Public'
23
+ ]).splitlines ()
24
+ alreadies = [x .split (':' )[0 ] for x in alreadies ]
25
+
26
+ out = subprocess .check_output (['git' , 'ls-files' ]).splitlines ()
27
+
28
+ suspect = []
29
+ for fp in out :
30
+ if fp in alreadies :
31
+ continue
32
+ if not os .stat (fp ).st_size :
33
+ continue
34
+ if fp in exceptions :
35
+ continue
36
+ if True in itertools .imap (fp .endswith , ('.py' , '.js' )):
37
+ suspect .append (fp )
38
+
39
+ for i , fp in enumerate (suspect ):
40
+ if not i :
41
+ print ('The following appear to lack a license preamble:' .upper ())
42
+ print (fp )
43
+
44
+ return len (suspect )
45
+
46
+
47
+ if __name__ == '__main__' :
48
+ import sys
49
+ sys .exit (run ())
Original file line number Diff line number Diff line change @@ -11,6 +11,15 @@ All code files need to start with the MPLv2 header::
11
11
# License, v. 2.0. If a copy of the MPL was not distributed with this
12
12
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
13
13
14
+ To check if any file is lacking a license preamble, run:
15
+
16
+ .. code-block :: shell
17
+
18
+ $ ./bin/sanspreamble
19
+
20
+ It will exit non-zero if there are files lacking the preamble. It only
21
+ checks git checked in files.
22
+
14
23
PEP8 is nice. All files are expected to be PEP8 and pyflakes compliant
15
24
and the PEP8 rules (and exceptions) are defined in ``setup.cfg `` under
16
25
the ``[flake8] `` heading.
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python
2
+
3
+ # This Source Code Form is subject to the terms of the Mozilla Public
4
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ # file, you can obtain one at http://mozilla.org/MPL/2.0/.
6
+
2
7
import os
3
8
import sys
4
9
Original file line number Diff line number Diff line change
1
+ /* This Source Code Form is subject to the terms of the Mozilla Public
2
+ License, v. 2.0. If a copy of the MPL was not distributed with this
3
+ file, you can obtain one at http://mozilla.org/MPL/2.0/. */
4
+
1
5
import React , { Component } from 'react'
2
6
import { Line } from 'react-chartjs-2'
3
7
import './App.css'
Original file line number Diff line number Diff line change
1
+ /* This Source Code Form is subject to the terms of the Mozilla Public
2
+ License, v. 2.0. If a copy of the MPL was not distributed with this
3
+ file, you can obtain one at http://mozilla.org/MPL/2.0/. */
4
+
1
5
import React from 'react' ;
2
6
import ReactDOM from 'react-dom' ;
3
7
import App from './App' ;
Original file line number Diff line number Diff line change
1
+ /* This Source Code Form is subject to the terms of the Mozilla Public
2
+ License, v. 2.0. If a copy of the MPL was not distributed with this
3
+ file, you can obtain one at http://mozilla.org/MPL/2.0/. */
4
+
1
5
import React from 'react' ;
2
6
import ReactDOM from 'react-dom' ;
3
7
import App from './App' ;
Original file line number Diff line number Diff line change
1
+ # This Source Code Form is subject to the terms of the Mozilla Public
2
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
3
+ # file, you can obtain one at http://mozilla.org/MPL/2.0/.
4
+
1
5
from django .core .cache import cache
2
6
from django .conf import settings
3
7
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python
2
+
3
+ # This Source Code Form is subject to the terms of the Mozilla Public
4
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ # file, you can obtain one at http://mozilla.org/MPL/2.0/.
6
+
2
7
from __future__ import print_function
3
8
4
9
import sys
Original file line number Diff line number Diff line change
1
+ # This Source Code Form is subject to the terms of the Mozilla Public
2
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
3
+ # file, you can obtain one at http://mozilla.org/MPL/2.0/.
4
+
1
5
import json
2
6
3
7
import pytest
Original file line number Diff line number Diff line change
1
+ # This Source Code Form is subject to the terms of the Mozilla Public
2
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
3
+ # file, you can obtain one at http://mozilla.org/MPL/2.0/.
4
+
1
5
from tecken .dockerflow_extra import check_redis_store_connected
2
6
3
7
You can’t perform that action at this time.
0 commit comments