Artifact 46fbf354bc33a30b16a2cd3781c07e8ae04004226d14e3238e83941250d3ca35:

Wiki page [internal-fields] by mario on 2018-07-04 17:02:59.
D 2018-07-04T17:02:59.764
L internal-fields
U mario
W 1188
## Implicit/internal field names

When [plugin meta data](wiki/Plugin+Meta+Data) comments get extracted into a hashtable, some common attributes might get prepoulated. Either implied from the filename, or from predefined defaults.


## # id: basename

With e.g. the [depends:](wiki/depends) field plugins can reference each other. And they typically just list basenames, not full paths. Because the point of PMD is to abstract filenames from plugin names.

      # fn: src/plugin/featurename.rb
      # id: featurename

Albeit one could use a literal `# id:` override in scripts, it's probably best to avoid ambigious basenames. For the scope of one application API all plugin basenames should be unique.


## # fn: .../src/plugin/filename.rb

When a script gets parsed, it's often necessary to retain its exact location. For brevity, I'd usually storel this in an internal field named `$meta.fn`

## # comment:

The remainder of the topmost comment block (after all PMD key:value fields) is meant to contain a longer [description](wiki/description). And for my implementatiosn I usually keep it as `$meta.comment` (albeit also used `$meta.doc` in some extractors.)

Z f5c6bfb818bf63e239b3de94d6e8765c