mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Enables tag matcher and
https://github.com/Baystation12/Baystation12/pull/11642
This commit is contained in:
32
tools/indentation.awk
Normal file
32
tools/indentation.awk
Normal file
@@ -0,0 +1,32 @@
|
||||
#! /usr/bin/awk -f
|
||||
|
||||
# Finds incorrect indentation of absolute path definitions in DM code
|
||||
# For example, the following fails on the indicated line:
|
||||
|
||||
#/datum/path/foo
|
||||
# x = "foo"
|
||||
# /datum/path/bar // FAIL
|
||||
# x = "bar"
|
||||
|
||||
{
|
||||
if ( comma != 1 ) { # No comma/'list('/etc at the end of the previous line
|
||||
if ( $0 ~ /^[\t ]+\/[^/*]/ ) { # Current line's first non-whitespace character is a slash, followed by something that is not another slash or an asterisk
|
||||
print FILENAME, ":", $0
|
||||
fail = 1
|
||||
}
|
||||
}
|
||||
|
||||
if ($0 ~ /,[\t ]*\\?\r?$/ || # comma at EOL
|
||||
$0 ~ /list[\t ]*\([\t ]*\\?\r?$/ || # start of a list()
|
||||
$0 ~ /pick[\t ]*\([\t ]*\\?\r?$/ ) { # start of a pick()
|
||||
comma = 1
|
||||
} else {
|
||||
comma = 0
|
||||
}
|
||||
}
|
||||
|
||||
END {
|
||||
if ( fail ) {
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user