Spelling: avoid generated files with --commits

This commit is contained in:
Martin Mathieson 2021-01-16 22:59:12 +00:00
parent 6a271f90c5
commit 1979750a78
2 changed files with 12 additions and 2 deletions

View File

@ -272,6 +272,9 @@ def findStrings(filename):
# Test for whether the given file was automatically generated. # Test for whether the given file was automatically generated.
def isGeneratedFile(filename): def isGeneratedFile(filename):
if not filename.endswith('.c'):
return False
# Open file # Open file
f_read = open(os.path.join(filename), 'r') f_read = open(os.path.join(filename), 'r')
lines_tested = 0 lines_tested = 0
@ -363,7 +366,7 @@ elif args.commits:
files = [f.decode('utf-8') files = [f.decode('utf-8')
for f in subprocess.check_output(command).splitlines()] for f in subprocess.check_output(command).splitlines()]
# Will examine dissector files only # Will examine dissector files only
files = list(filter(lambda f : isAppropriateFile(f), files)) files = list(filter(lambda f : isAppropriateFile(f) and not isGeneratedFile(f), files))
elif args.open: elif args.open:
# Unstaged changes. # Unstaged changes.
command = ['git', 'diff', '--name-only'] command = ['git', 'diff', '--name-only']

View File

@ -1,4 +1,3 @@
0x%02x 0x%02x
0x%08x 0x%08x
16bit 16bit
@ -64,6 +63,7 @@ authtype
autoconfiguration autoconfiguration
autodiscovery autodiscovery
autoneg autoneg
autosar
available available
avaya avaya
backend backend
@ -85,6 +85,7 @@ blackhole
bnode bnode
bootfile bootfile
bootloader bootloader
bootopt
bootp bootp
broadcom broadcom
bsmap bsmap
@ -251,6 +252,7 @@ desegment
desegmentation desegmentation
desegmenting desegmenting
deselect deselect
devcap
devmode devmode
dfilter dfilter
dfsauth dfsauth
@ -429,6 +431,7 @@ initializers
initializes initializes
initializing initializing
inline inline
inode
interferer interferer
interleaving interleaving
interruptible interruptible
@ -492,6 +495,7 @@ manuf
mappable mappable
maybefcs maybefcs
mcast mcast
mcsset
measurements measurements
megabit megabit
megaco megaco
@ -549,6 +553,7 @@ multirat
multirate multirate
multislot multislot
multistate multistate
mumbai
nacks nacks
namelen namelen
namespace namespace
@ -673,6 +678,7 @@ protected
protoabbrev protoabbrev
protobuf protobuf
protocolie protocolie
proxying
pscell pscell
pseudowire pseudowire
ptvcursor ptvcursor
@ -850,6 +856,7 @@ spoofing
spooled spooled
srbid srbid
srcport srcport
srvcc
ssupervisor ssupervisor
stateful stateful
statusbar statusbar