Skip to content

Commit 3cd4c00

Browse files
authored
Fix typos and prettify MD/YAML files (#48)
Found through these commands: - codespell . - prettier --write .
1 parent 4c162c3 commit 3cd4c00

35 files changed

+259
-216
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ jobs:
1010
- macos-latest
1111
- windows-latest
1212
python-version:
13-
- '3.6'
14-
- '3.7'
15-
- '3.8'
16-
- '3.9'
17-
- '3.10'
13+
- "3.6"
14+
- "3.7"
15+
- "3.8"
16+
- "3.9"
17+
- "3.10"
1818
steps:
1919
- uses: actions/checkout@v2
2020
- name: Set up Python

CHANGELOG.md

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Changelog
2+
23
All notable changes to this project will be documented in this file.
34

45
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
@@ -7,117 +8,158 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
78
## [Unreleased]
89

910
## [0.13.0] - 2022-08-09
11+
1012
### Added
13+
1114
- Support for Flake8 5 ([#45](https://github.com/dlint-py/dlint/issues/45))
1215

1316
### Changed
17+
1418
- Support `usedforsecurity=False` parameter to hashlib constructors ([#39](https://github.com/dlint-py/dlint/issues/39))
1519

1620
## [0.12.0] - 2021-10-27
21+
1722
### Added
23+
1824
- Support for Python 3.10
1925
- Support for Flake8 4 ([#36](https://github.com/dlint-py/dlint/issues/36))
2026

2127
### Removed
28+
2229
- Support for Python 2.7 ([#3](https://github.com/dlint-py/dlint/issues/3))
2330

2431
## [0.11.0] - 2020-10-30
32+
2533
### Added
34+
2635
- Support for Python 3.9 ([#32](https://github.com/dlint-py/dlint/issues/32))
2736

2837
### Fixed
38+
2939
- False positive for `DUO107` when `xml.etree.ElementTree.{Element,SubElement}` used ([#28](https://github.com/dlint-py/dlint/issues/28))
3040
- False positive for `DUO116` when `shell=False` used ([#31](https://github.com/dlint-py/dlint/pull/31))
3141

3242
### Removed
43+
3344
- Support for Python 3.5
3445

3546
## [0.10.3] - 2020-03-09
47+
3648
### Fixed
49+
3750
- False positive for `DUO138` when expressions aren't backtrackable ([#14](https://github.com/dlint-py/dlint/issues/14))
3851

3952
## [0.10.2] - 2020-02-19
53+
4054
### Changed
55+
4156
- Cache namespace results and minimize kwarg checks by grouping similar rules - ~500% speed up ([#18](https://github.com/dlint-py/dlint/issues/18))
42-
- Only run linters that are selected - speed up depends on number of linters seleted ([#19](https://github.com/dlint-py/dlint/issues/19))
57+
- Only run linters that are selected - speed up depends on number of linters selected ([#19](https://github.com/dlint-py/dlint/issues/19))
4358

4459
### Fixed
60+
4561
- The `--print-dlint-linters` flag on Windows ([#17](https://github.com/dlint-py/dlint/issues/17))
4662

4763
## [0.10.1] - 2020-01-21
64+
4865
### Fixed
66+
4967
- Crash in `DUO138` when malformed regular expression ([#15](https://github.com/dlint-py/dlint/issues/15))
5068

5169
## [0.10.0] - 2020-01-21
70+
5271
### Added
72+
5373
- `DUO137`: lint for insecure itsdangerous kwarg usage ([#36](https://github.com/duo-labs/dlint/issues/36))
5474
- `DUO138`: lint for regular expression catastrophic backtracking in re module ([#41](https://github.com/duo-labs/dlint/issues/41))
5575

5676
### Fixed
77+
5778
- False positive for `DUO137` when kwarg missing ([#39](https://github.com/duo-labs/dlint/issues/39))
5879

5980
## [0.9.2] - 2019-11-21
81+
6082
### Fixed
83+
6184
- False negative with arbitrary depth from import alias in bad module attribute ([#32](https://github.com/duo-labs/dlint/issues/32))
6285
- False negative with arbitrary depth from import wildcard in bad module attribute ([#33](https://github.com/duo-labs/dlint/issues/33))
6386

6487
## [0.9.1] - 2019-11-06
88+
6589
### Fixed
90+
6691
- False positive with `input` as variable name ([#31](https://github.com/duo-labs/dlint/issues/31))
6792

6893
## [0.9.0] - 2019-10-13
94+
6995
### Added
96+
7097
- `DUO116`: rule for `subprocess.run` ([#24](https://github.com/duo-labs/dlint/issues/24))
7198
- The `--print-dlint-linters` command-line flag to print all Dlint linters ([#26](https://github.com/duo-labs/dlint/issues/26))
7299
- `DUO136`: lint for insecure xmlsec usage ([#27](https://github.com/duo-labs/dlint/issues/27))
73100

74101
### Changed
102+
75103
- Visitor strategy to minimize node visits - ~25% speed up ([#28](https://github.com/duo-labs/dlint/issues/28))
76104

77105
### Fixed
106+
78107
- False negative with nested imports in bad module attribute ([#30](https://github.com/duo-labs/dlint/issues/30))
79108

80109
### Removed
110+
81111
- `dlint.linters.helpers.bad_kwarg_use`: use of `attribute_name` in favor of fully specified `module_path` ([#19](https://github.com/duo-labs/dlint/issues/19))
82112
- `dlint.tree`: use of `kwarg_attribute` in favor of `kwarg_module_path` ([#21](https://github.com/duo-labs/dlint/issues/21))
83113
- `dlint.linters.helpers.bad_name_attribute_use`: use of attribute list in favor of fully specified module path ([#20](https://github.com/duo-labs/dlint/issues/20))
84114

85115
## [0.8.0] - 2019-09-18
116+
86117
### Added
118+
87119
- Support for Python 3.8 ([#12](https://github.com/duo-labs/dlint/issues/12))
88120
- `DUO134`: lint for insecure cryptography usage ([#6](https://github.com/duo-labs/dlint/issues/6))
89121
- `DUO135`: lint for insecure defusedxml usage ([#5](https://github.com/duo-labs/dlint/issues/5))
90122

91123
### Deprecated
124+
92125
- `dlint.linters.helpers.bad_kwarg_use`: use of `attribute_name` in favor of fully specified `module_path` ([#19](https://github.com/duo-labs/dlint/issues/19))
93126
- `dlint.tree`: use of `kwarg_attribute` in favor of `kwarg_module_path` ([#21](https://github.com/duo-labs/dlint/issues/21))
94127
- `dlint.linters.helpers.bad_name_attribute_use`: use of attribute list in favor of fully specified module path ([#20](https://github.com/duo-labs/dlint/issues/20))
95128

96129
### Fixed
130+
97131
- False negative when deep imports are not fully specified in bad module attribute ([#1](https://github.com/duo-labs/dlint/issues/1))
98132
- False negative - consider `async` functions in bad name attribute ([7bd249e](https://github.com/duo-labs/dlint/commit/7bd249e80a91f7c38f2c1f05045a826e0bef3246))
99133
- False negative in various import scenarios when using `attribute_name` in bad kwarg ([#19](https://github.com/duo-labs/dlint/issues/19))
100134
- False negative in various import scenarios when using `kwarg_attribute` in bad kwarg ([#21](https://github.com/duo-labs/dlint/issues/21))
101135
- False negative in various import scenarios when using attribute list in bad name attribute ([#20](https://github.com/duo-labs/dlint/issues/20))
102136

103137
## [0.7.0] - 2019-08-24
138+
104139
### Added
140+
105141
- `DUO133`: lint for pycrypto usage ([#7](https://github.com/duo-labs/dlint/issues/7))
106142

107143
### Fixed
144+
108145
- False positive when bad builtin is overwritten by import ([#16](https://github.com/duo-labs/dlint/issues/16))
109146
- False negative when bad module attribute uses import alias ([#2](https://github.com/duo-labs/dlint/issues/2))
110147
- False positive when bad module attribute not imported ([#14](https://github.com/duo-labs/dlint/issues/14))
111148

112149
## [0.6.0] - 2019-08-12
150+
113151
### Added
152+
114153
- Support for Python 3.5 and 3.7 ([#9](https://github.com/duo-labs/dlint/issues/9))
115154
- `DUO131`: lint for disabling urllib3 warnings
116155
- `DUO132`: lint for disabling urllib3 HTTPS certification verification
117156

118157
### Removed
158+
119159
- `FormatStringLinter`, previously `DUO104`, as it was a disabled expirement ([#15](https://github.com/duo-labs/dlint/issues/15))
120160

121161
## [0.5.0] - 2019-07-17
162+
122163
### Added
164+
123165
- Initial public release of Dlint

CONTRIBUTING.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ knowledge. **Further, please check out our brief section on [developing](https:/
1616

1717
When adding new linters:
1818

19-
* New linters should be added to the `dlint/linters/` directory.
20-
* Add a new file and class inheriting from `base.BaseLinter` for each new linter.
21-
* Add a "pass-through" import of the new class to `dlint.linters.__init__.py`.
22-
* Add the new class to `ALL` in `dlint.linters.__init__.py`.
23-
* Add documentation link in `docs/README.md`.
24-
* Add documentation file in `docs/linters/`.
25-
* Ensure new rules are properly tested (high or complete test coverage).
26-
* Ensure new code adheres to the style guide/linting process.
27-
* Add new rule information to `CHANGELOG.md` under `Unreleased` section, `Added` sub-section.
19+
- New linters should be added to the `dlint/linters/` directory.
20+
- Add a new file and class inheriting from `base.BaseLinter` for each new linter.
21+
- Add a "pass-through" import of the new class to `dlint.linters.__init__.py`.
22+
- Add the new class to `ALL` in `dlint.linters.__init__.py`.
23+
- Add documentation link in `docs/README.md`.
24+
- Add documentation file in `docs/linters/`.
25+
- Ensure new rules are properly tested (high or complete test coverage).
26+
- Ensure new code adheres to the style guide/linting process.
27+
- Add new rule information to `CHANGELOG.md` under `Unreleased` section, `Added` sub-section.
2828

2929
From here, please create a [pull request](https://github.com/dlint-py/dlint/pulls)
3030
with your changes and wait for a review.
@@ -36,7 +36,7 @@ first. This issue should include a snippet of code for reproducing the bug.
3636

3737
E.g.
3838

39-
*I expected `dlint` to flag the following code for faulty use of the `foo` module:*
39+
_I expected `dlint` to flag the following code for faulty use of the `foo` module:_
4040

4141
```
4242
from bar import foo
@@ -46,7 +46,7 @@ widget = foo.baz(var)
4646
send_result(widget)
4747
```
4848

49-
*Please update `dlint` to catch this. Thanks!*
49+
_Please update `dlint` to catch this. Thanks!_
5050

5151
After reporting the issue, if you'd like to help fix it, please create a
5252
[pull request](https://github.com/dlint-py/dlint/pulls) with the

README.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ Dlint is a tool for encouraging best coding practices and helping ensure Python
1111
> aggressively pursue static code analysis. Even more valuable than the
1212
> hundreds of serious bugs I have prevented with it is the change in mindset
1313
> about the way I view software reliability and code quality.
14+
>
1415
> - [John Carmack, 2011](https://www.gamasutra.com/view/news/128836/InDepth_Static_Code_Analysis.php)
1516
1617
> For a static analysis project to succeed, developers must feel they benefit
1718
> from and enjoy using it.
19+
>
1820
> - [Lessons from Building Static Analysis Tools at Google](https://cacm.acm.org/magazines/2018/4/226371-lessons-from-building-static-analysis-tools-at-google/fulltext)
1921
2022
For documentation and a list of rules see [docs](https://github.com/dlint-py/dlint/tree/master/docs).
@@ -65,8 +67,8 @@ $ python -m flake8 --select=DUO test.py
6567
test.py:2:1: DUO105 use of "exec" is insecure
6668
```
6769

68-
* *Why is this insecure? To learn more visit [`/docs/linters/DUO105.md`](https://github.com/dlint-py/dlint/blob/master/docs/linters/DUO105.md).*
69-
* *Why `DUO`? Dlint was originally developed by the [Duo Labs](https://duo.com/blog/introducing-dlint-robust-static-analysis-for-python) team.*
70+
- _Why is this insecure? To learn more visit [`/docs/linters/DUO105.md`](https://github.com/dlint-py/dlint/blob/master/docs/linters/DUO105.md)._
71+
- _Why `DUO`? Dlint was originally developed by the [Duo Labs](https://duo.com/blog/introducing-dlint-robust-static-analysis-for-python) team._
7072

7173
The `--select=DUO` flag tells `flake8` to only run Dlint lint rules.
7274

@@ -88,12 +90,12 @@ Dlint results can also be included inline in your editor for fast feedback.
8890
This typically requires an editor plugin or extension. Here are some starting
8991
points for common editors:
9092

91-
* Vim: [https://github.com/vim-syntastic/syntastic](https://github.com/vim-syntastic/syntastic)
92-
* Emacs: [https://github.com/flycheck/flycheck](https://github.com/flycheck/flycheck)
93-
* Sublime: [https://github.com/SublimeLinter/SublimeLinter-flake8](https://github.com/SublimeLinter/SublimeLinter-flake8)
94-
* PyCharm: [https://foxmask.net/post/2016/02/17/pycharm-running-flake8/](https://foxmask.net/post/2016/02/17/pycharm-running-flake8/)
95-
* Atom: [https://atom.io/packages/linter-flake8](https://atom.io/packages/linter-flake8)
96-
* Visual Studio Code: [https://code.visualstudio.com/docs/python/linting#_flake8](https://code.visualstudio.com/docs/python/linting#_flake8)
93+
- Vim: [https://github.com/vim-syntastic/syntastic](https://github.com/vim-syntastic/syntastic)
94+
- Emacs: [https://github.com/flycheck/flycheck](https://github.com/flycheck/flycheck)
95+
- Sublime: [https://github.com/SublimeLinter/SublimeLinter-flake8](https://github.com/SublimeLinter/SublimeLinter-flake8)
96+
- PyCharm: [https://foxmask.net/post/2016/02/17/pycharm-running-flake8/](https://foxmask.net/post/2016/02/17/pycharm-running-flake8/)
97+
- Atom: [https://atom.io/packages/linter-flake8](https://atom.io/packages/linter-flake8)
98+
- Visual Studio Code: [https://code.visualstudio.com/docs/python/linting#\_flake8](https://code.visualstudio.com/docs/python/linting#_flake8)
9799

98100
# Integrating
99101

@@ -107,11 +109,11 @@ Dlint's custom plugins are built on a [simple naming convention](https://packagi
107109
and rely on [Python modules](https://docs.python.org/3/distutils/examples.html#pure-python-distribution-by-module).
108110
To make a Dlint custom plugin use the following conventions:
109111

110-
* The Python module name **must** start with `dlint_plugin_`.
111-
* The linter class name **must** start with `Dlint`.
112-
* The linter class **should** inherit from `dlint.linters.base.BaseLinter`.
113-
* If for some reason you'd like to avoid this, then you **must** implement
114-
the `get_results` function appropriately and inherit from `ast.NodeVisitor`.
112+
- The Python module name **must** start with `dlint_plugin_`.
113+
- The linter class name **must** start with `Dlint`.
114+
- The linter class **should** inherit from `dlint.linters.base.BaseLinter`.
115+
- If for some reason you'd like to avoid this, then you **must** implement
116+
the `get_results` function appropriately and inherit from `ast.NodeVisitor`.
115117

116118
See an [example plugin](https://github.com/dlint-py/dlint-plugin-example) for further details.
117119

0 commit comments

Comments
 (0)