Skip to content

Commit

Permalink
Improve git grep code quality checks
Browse files Browse the repository at this point in the history
  • Loading branch information
out-of-phaze committed Jan 18, 2025
1 parent 5251e14 commit f083257
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions test/check-paths.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,34 +23,35 @@ exactly() { # exactly N name search [mode] [filter]

# With the potential exception of << if you increase any of these numbers you're probably doing it wrong
# Additional exception August 2020: \b is a regex symbol as well as a BYOND macro.
exactly 1 "escapes" '\\\\(red|blue|green|black|b|i[^mc])'
exactly 8 "Del()s" '\WDel\('
exactly 3 "escapes" '\\(red|blue|green|black|b|i[^mc])'
exactly 3 "Del()s" '(?<!world/)\bDel\(' -P
exactly 2 "/atom text paths" '"/atom'
exactly 2 "/area text paths" '"/area'
exactly 2 "/datum text paths" '"/datum'
exactly 2 "/mob text paths" '"/mob'
exactly 6 "/obj text paths" '"/obj'
exactly 10 "/turf text paths" '"/turf'
exactly 1 "world<< uses" 'world<<|world[[:space:]]<<'
exactly 90 "'in world' uses" 'in world'
exactly 1 "world.log<< uses" 'world.log<<|world.log[[:space:]]<<'
exactly 18 "<< uses" '(?<!<)<<(?!<)' -P
exactly 9 ">> uses" '>>(?!>)' -P
exactly 1 "world<< uses" 'world\s*<<'
exactly 75 "'in world' uses" '\s+\bin world\b(?=\s*$|\s*//|\s*\))' -P
exactly 1 "world.log<< uses" 'world.log\s*<<'
exactly 18 "<< uses" '(?<![<\\])<<(?!<)' -P
exactly 1 "direct_output uses" '\bdirect_output\('
exactly 4 ">> uses" '(?<![>\\])>>(?!>)' -P
exactly 0 "incorrect indentations" '^( {4,})' -P
exactly 23 "text2path uses" 'text2path'
exactly 4 "update_icon() override" '/update_icon\((.*)\)' -P
exactly 0 "goto uses" 'goto '
exactly 4 "update_icon() overrides" '\/update_icon\(' -P
exactly 0 "goto uses" '\bgoto\b'
exactly 9 "atom/New uses" '^/(obj|atom|area|mob|turf).*/New\('
exactly 1 "decl/New uses" '^/decl.*/New\('
exactly 0 "tag uses" '\stag = ' -P '*.dmm'
exactly 3 "unmarked globally scoped variables" '^(/|)var/(?!global)' -P
exactly 0 "global-marked member variables" '\t(/|)var.*/global/.+' -P
exactly 0 "static-marked globally scoped variables" '^(/|)var.*/static/.+' -P
exactly 3 "tag uses" '(?<!/)\btag\s*=(?!=)' -P '*.dm *.dmm'
exactly 3 "unmarked globally scoped variables" '^/?var/(?!global)' -P
exactly 0 "global-marked member variables" '\t+/?var.*/global/' -P
exactly 0 "static-marked globally scoped variables" '^/?var.*/static/.+' -P
exactly 1 "direct usage of decls_repository.get_decl()" 'decls_repository\.get_decl\(' -P
exactly 19 "direct loc set" '(\t|;|\.)loc\s*=(?!=)' -P
exactly 19 "direct loc set" '[^ ,(/]\bloc\s*=(?!=)' -P
exactly 0 "magic number mouse opacity set" 'mouse_opacity\s*=\s*[0-2]' -P
exactly 1 "magic number density set" '\bdensity\s*=\s*[01]' -P
exactly 0 "magic number anchored set" '\banchored\s*=\s*[01]' -P
exactly 0 "magic number density set" '\bdensity\s*=\s*[01]\b' -P
exactly 0 "magic number anchored set" '\banchored\s*=\s*[01]\b' -P
exactly 0 "magic number opacity set" '\bopacity\s*=\s*[01](?!\.)' -P

# With the potential exception of << if you increase any of these numbers you're probably doing it wrong
Expand Down

0 comments on commit f083257

Please sign in to comment.