There are many commits where people are trying to appease portlint without actually trying to understand what the problem was or why it raises them. Mostly things are shuffled around until portlint no longer complains (or so it appears) and it causes lots of churn in the repository with little improvement in ports. Can portlint be more descriptive/verbose? For example, when portlint says WARN: Makefile: "USES" has to appear earlier. it should point people to https://www.freebsd.org/doc/en/books/porters-handbook/porting-order.html Maybe there could be error codes and a --explain flag like what rustc has to give a more verbose description of the problem.
> Maybe there could be error codes and a --explain flag like what > rustc has to give a more verbose description of the problem. E.g. `rustc --explain E0001` will print the text from https://doc.rust-lang.org/error-index.html#E0001 to stdout etc.
+1 on per rule error codes. Have thought about this many times when thinking about ways to improve portlint (like a proper lexer/parser for bmake/Makefiles implementation) I think a decent place for this would be the wiki, where we could then refer onto the handbook for specific cases or further information, if necessary.
Alternatively a data file that comes with portlint, to keep the explanations/prose away from the rule detection code, and make updating that content easier for contributors
Pointing back to the Porter's Handbook makes a lot of sense. Having another level of mapping may get cumbersome (but I understand the ask/outcome). In the meantime, if there are obvious outstanding instances of this (like USES) can you please submit patches, and I'll fold them in. Go ahead and use this PR.