GENDARME(5)

🌸 NAME

Gendarme β€” rule-based code analysis for Mono. It's giving "your code, but make it ✨judged✨". πŸ’…


✨ FILE FORMATS ✨

Okay bestie, Gendarme reads a few little config-type files and you're gonna want to know them all, so let's go. 🫢

πŸŽ€ ignore-file

This one filters defects out of your gendarme reports, so you don't have to look at the stuff you already know about. It's a line-oriented format, meaning the first characters of each line tell Gendarme how to read that line:

  • # β€” this line is a comment, so it gets skipped entirely. πŸ’€
  • R: β€” filters out a rule, and you put the full name of the rule here.
  • A: β€” filters out an assembly. The extension can be omitted, no big deal.
  • T: β€” filters out a namespace qualified type name.
  • M: β€” filters out a method. It has to contain the full method name exactly as it appears in the report, fr fr.

Also! You can generate an ignore-file automatically (using gd2i, an icon) from an XML defect list produced by Gendarme. No cap. πŸ¦‹

πŸ¦‹ rules.xml

This file works together with the --set option to control and configure which rules Gendarme actually uses. It contains a set of named rules (aka rule sets) and each rule set contains a list of rules.

Rules have required from and include attributes, optional exclude and applyTo attributes, and optional parameter child elements. Let's break those down:

  • The from attribute is the path of a dll to load ("Gendarme.Rules.BadPractice.dll"). Relative paths are relative to the gendarme executable. πŸ“
  • The include attribute may be "*" to match every single rule in the dll, or a list of rule names separated by '|' ("WhizBangRule | MyRule").
  • The exclude attribute is a list of rule names separated by '|' ("IckyRule"). These will override any rules matched by the include attribute β€” so yes, exclude wins. πŸ’…
  • The applyTo attribute may be "all", "visible", or "nonvisible". If it's all (the default) then all types in the assemblies are checked; if it's visible then only the externally visible types are checked; if it's nonvisible then only the internally visible types are checked. πŸ‘€
  • The parameter child element is used to customize the behavior of a rule within a dll. It has three required attributes: rule, property, and value. rule is the name of the applicable rule ("AvoidSmallNamespaceRule"), property is the name of a public property in the rule ("Minimum"), and value is the value to assign to the property ("10"). Slay. ✨

πŸ’œ gendarme.exe.config

Used by debug versions of Gendarme to enable logging for rules. A config file will be generated automatically by the make file. To enable logging for a rule, edit the config file, add a switch using the rule's name, and set the value to 1. That's it, that's the whole vibe. πŸ”₯


Copyright (C) 2005-2010 Novell, Inc (http://www.novell.com)


🌈 MAILING LISTS

Mailing lists are listed at the http://groups.google.com/group/gendarme β€” come hang out 🫢


⭐ WEB SITE

http://www.mono-project.com/Gendarme


πŸ‘‘ SEE ALSO

gendarme(1),gd2i(1)


And that's the whole page, bestie!! This was Gendarme(Gendarme 4.2.0.0), and yes the version is literally right there in the title because she's extra like that. Now go forth and let the rules rule. πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from