Page MenuHomePhabricator

Remove @ingroup from @file blocks
Open, LowPublic

Assigned To
None
Authored By
Krinkle
Sep 14 2019, 4:22 AM
Referenced Files
F30332658: counter.png
Sep 14 2019, 4:22 AM
F30332354: class.png
Sep 14 2019, 4:22 AM
F30332693: no-file.png
Sep 14 2019, 4:22 AM
F30332352: list.png
Sep 14 2019, 4:22 AM
F30332353: file.png
Sep 14 2019, 4:22 AM

Description

For the vast majority of PHP files that only define a class, the @file annotation does not appear to be useful.

In fact, it actively clutters Doxygen's index with duplicate file-based entries that are less useful than their class-based counterparts.

Example: filerepo
list.png (1×1 px, 177 KB)
file.png (1×2 px, 217 KB)
class.png (1×2 px, 271 KB)
Group menuFile pageClass page

I imagine one would only visit the File page by mistake, leading to a mostly empty page with 1 significant link, that brings you to the class page.

Below an example of a group that doesn't do this (these class files do actually have @file but without @ingroup on those, thus emulating the same outcome as if they didn't have @file).

counter.png (1×2 px, 190 KB)
Group menu (no @file duplicates)

Note that for the purposes of the File browser, @file is not considered. The File browser in Doxygen shows all files no matter what. For example, includes/ReadOnly.php has no @file comment currently in master, but it's file is still known in the browser:

no-file.png (828×1 px, 91 KB)

In summary

The only purpose of @file is to create a dedicated menu item in Doxygen outside the file browser, about a file. This is mainly useful as a way to document a file that does something other than define a class (which would already get its own menu item).

For example, a file like DefaultSettings.php or GlobalFunctions.php can be useful to add to the menu so that its variables/functions can be navigated to from the module browser (given that variables and functions are usually not placed in a Doxygen group directly).

For those files, the @file is to the variables and functions, what @class is to class members and methods. A container for documentable entities that we wouldn't put @ingroup on directly.

Relevant conventions doc: Manual:Coding_conventions

Progress for areas more or less the CPT and Perf team scopes:

  • API
  • Database
  • ExternalStorage
  • Entry points
  • File backend
  • FileRepo
  • Installer
  • ObjectStore (libs/objectcache)
  • Profiler
  • Redis
  • ResourceLoader

Event Timeline

Krinkle edited projects, added Platform Engineering; removed Performance-Team.

Perhaps an easier step in the interim could be to at least remove @ingroup from @file comment blocks in class-only files, and (if not already) add them to the class comment block two lines down.

apaskulin moved this task from Triage Meeting Inbox to Icebox on the Platform Engineering board.
Krinkle renamed this task from Consider removing "@file" from class files to Consider removing "@file" from class files (or remove @ingroup from @file blocks).Feb 5 2020, 11:06 PM
Krinkle updated the task description. (Show Details)

Change 591137 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/core@master] rdbms: Move Profiler @ingroup docs from file to class

https://gerrit.wikimedia.org/r/591137

Krinkle renamed this task from Consider removing "@file" from class files (or remove @ingroup from @file blocks) to Remove @ingroup from @file blocks.Apr 20 2020, 7:09 PM

Reducing scope to only correcting the index to show the class instead of the file, and to move any file-level descriptions to their classes so that they are actually used by Doxygen where the user expects it.

Removing @file itself I'll leave for another task because it seems the only thing preventing Doxygen from indexing the license header in association with random nearby stuff is indeed @file. It effectively functions as "ignore this block", except that it also means ".. and add it to the list of files". Which is harmless so long as we don't put anything like @ingroup on it.

Change 591137 merged by jenkins-bot:
[mediawiki/core@master] rdbms: Move Profiler @ingroup docs from file to class

https://gerrit.wikimedia.org/r/591137