Commit Graph

24 Commits

Author SHA1 Message Date
Martin Mathieson 55d3a9db9e tools/check_*.py: allow multiple --file entries 2022-02-20 23:12:10 +00:00
Martin Mathieson 4633621c3e Some spelling fixes 2022-02-17 10:28:45 +00:00
Martin Mathieson e11cdf2f46 Fix some spelling errors 2021-11-29 17:46:16 +00:00
Martin Mathieson 263189e23d Fix some spelling errors. 2021-11-18 04:43:51 +00:00
Martin Mathieson a5df18e51e Fix some spelling errors 2021-10-11 04:44:49 +00:00
Martin Mathieson a156d7d05d Fix some spelling errors. 2021-09-28 09:50:58 +00:00
Martin Mathieson dd667dddf0 Some spelling fixes 2021-09-18 20:52:04 +00:00
Martin Mathieson d06287ec2e Some more spelling fixes.
Changed script to allow recursive search for multi-words.
2021-04-10 22:50:52 +00:00
Martin Mathieson e83ee9b66a Add more common words to spelling dict. 2021-04-03 17:06:35 +00:00
Martin Mathieson cd77e5aa5f Some more spelling fixes.
Also add more words to dictionary file.
2021-02-21 09:59:04 +00:00
Martin Mathieson e5658ccb5c Spell checking script: reduce output.
- Ignore all hex numbers from within strings.
- Add a few more words to dict file
2021-02-17 09:36:23 +00:00
Martin Mathieson aa78bb8546 tools/check_spelling.py: Fix args handling 2021-01-25 12:25:54 +00:00
Moshe Kaplan e69a20f5c8 check_spelling.py: Avoid duplicating list entries
Avoid duplicating list entries and modifying a list during
iteration.
2021-01-25 10:54:31 +00:00
Martin Mathieson 1979750a78 Spelling: avoid generated files with --commits 2021-01-16 22:59:12 +00:00
Martin Mathieson 41d6deb7c3 Scripts: Check that files exist.
Prompted by seeing an exception when files have been deleted by commits.
2020-12-31 12:02:42 +00:00
Martin Mathieson eef4ba7ed7 More spelling fixes. 2020-12-20 16:31:18 +00:00
Martin Mathieson df651aca91 Spelling improvements
Improve script by ignoring common contractions, dealing with
e.g. \n within strings, and finding multiple concatenated words even
when no camelCase is used.

Also includes some actual spelling fixes.
2020-11-22 11:30:24 +00:00
Martin Mathieson 6dd9c098ad check_typed_item_calls.py: add --consecutive flag
Add a check to point out where consecutive items have the same filter
but different labels.  Quite a few of these look like bugs.

Also, make some REs raw strings, as identified as an issue in
https://gitlab.com/wireshark/wireshark/-/merge_requests/346
2020-09-28 08:01:21 +00:00
Jeff Widman 8d7ebc732e Fix issues discovered by common python linters
Fix some issues discovered by common python linters including:
* switch `None` comparisons to use `is` rather than `==`. Identity !=
equality, and I've spent 40+ hours before tracking down a subtle bug
caused by exactly this issue. Note that this may introduce a problem if
one of the scripts is depending on this behavior, in which case the
comparison should be changed to `True`/`False` rather than `None`.
* Use `except Exception:` as bare `except:` statements have been
discouraged for years. Ideally for some of these we'd examine if there
were specific exceptions that should be caught, but for now I simply
caught all. Again, this could introduce very subtle behavioral changes
under Python 2, but IIUC, that was all fixed in Python 3, so safe to
move to `except Exception:`.
* Use more idiomatic `if not x in y`--> `if x not in y`
* Use more idiomatic 2 blank lines. I only did this at the beginning,
until I realized how overwhelming this was going to be to apply, then I
stopped.
* Add a TODO where an undefined function name is called, so will fail
whenever that code is run.
* Add more idiomatic spacing around `:`. This is also only partially
cleaned up, as I gave up when I saw how `asn2wrs.py` was clearly
infatuated with the construct.
* Various other small cleanups, removed some trailing whitespace and
improper indentation that wasn't a multiple of 4, etc.

There is still _much_ to do, but I haven't been heavily involved with
this project before, so thought this was a sufficient amount to put up
and see what the feedback is.

Linters that I have enabled which highlighted some of these issues
include:
* `pylint`
* `flake8`
* `pycodestyle`
2020-09-26 04:38:18 +00:00
Martin Mathieson fc64ba242a More dissector spelling fixes. 2020-09-24 16:40:51 +00:00
Martin Mathieson 82827278f7 More dissector string spelling fixes.
Finally, it is becoming difficult to find more.
2020-09-13 09:03:08 +01:00
Martin Mathieson d461bf3025 Yet more spelling fixes.
Includes small updates to the script and wireshark dictionary.
Probably the last spelling fixes from me for a while.
2020-09-07 16:35:13 +01:00
Martin Mathieson de115f6cd5 check_spelling.py: fix a variable name, and add a few dictionary words. 2020-09-07 09:36:53 +01:00
Martin Mathieson 22e02a9d06 Add spell-checking script.
check_spelling.py scans Wireshark source or documentation files,
using the general dictionary from pyspellcheck, augmented by the contents
of wireshark_words.txt.

Can scan:
- entire folders (recursively)
- individual files
- open files
- files affected by recent git changes
2020-09-06 18:47:58 +00:00