You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pylint plugin to enforce consistent file/module header.
@@ -17,14 +17,16 @@ pip install pylintfileheader
17
17
## Configuration
18
18
19
19
Generate a `.pylintrc` file by executing `pylint --generate-rcfile`.
20
-
Then add `pylintfileheader` to the plugins to load and set the `file-header` option to the [regular expression](https://docs.python.org/3/library/re.html#regular-expression-syntax) that the file header should match.
20
+
Then add `pylintfileheader` to the plugins to load and set the `file-header` option to the [regular expression](https://docs.python.org/3/library/re.html#regular-expression-syntax) that the file header should match.
21
21
When the `file-header` setting is omitted, pylint will pass.
22
22
23
+
*`file-header-ignore-empty-files` turns on the mode of ignoring the empty files, like `__init__.py`. The default value is `False`.
24
+
23
25
## Example
24
26
25
27
### Setup
26
28
27
-
***.pylintrc**:
29
+
***.pylintrc**:
28
30
29
31
```pylintrc
30
32
[MASTER]
@@ -33,7 +35,7 @@ When the `file-header` setting is omitted, pylint will pass.
33
35
file-header=# -----------\n#[ \w]*\n# -----------
34
36
```
35
37
36
-
***valid_example.py**:
38
+
***valid_example.py**:
37
39
38
40
```python
39
41
# -----------
@@ -43,7 +45,7 @@ When the `file-header` setting is omitted, pylint will pass.
43
45
print('I am a valid example')
44
46
```
45
47
46
-
***invalid_example.py**:
48
+
***invalid_example.py**:
47
49
48
50
```python
49
51
# lorem ipsum
@@ -53,15 +55,15 @@ When the `file-header` setting is omitted, pylint will pass.
53
55
54
56
### Evaluation
55
57
56
-
*`pylint valid_example.py` evaluates to:
58
+
*`pylint valid_example.py` evaluates to:
57
59
```
58
60
Using config file /path/to/your/.pylintrc
59
61
60
62
------------------------------------
61
63
Your code has been rated at 10.00/10
62
64
```
63
65
64
-
*`pylint invalid_example.py` evaluates to:
66
+
*`pylint invalid_example.py` evaluates to:
65
67
```
66
68
Using config file /path/to/your/.pylintrc
67
69
************* Module invalid_example
@@ -73,10 +75,10 @@ When the `file-header` setting is omitted, pylint will pass.
73
75
74
76
## Contribution
75
77
76
-
If you found a bug or are missing a feature do not hesitate to [file an issue](https://github.com/HaaLeo/pylint-file-header/issues/new/choose).
78
+
If you found a bug or are missing a feature do not hesitate to [file an issue](https://github.com/HaaLeo/pylint-file-header/issues/new/choose).
77
79
Pull Requests are welcome!
78
80
79
81
## Support
80
82
81
-
When you like this package make sure to [star the repository](https://github.com/HaaLeo/pylint-file-header/stargazers). I am always looking for new ideas and feedback.
83
+
When you like this package make sure to [star the repository](https://github.com/HaaLeo/pylint-file-header/stargazers). I am always looking for new ideas and feedback.
82
84
In addition, it is possible to [donate via paypal](https://www.paypal.me/LeoHanisch).
0 commit comments