Bug 278591

Summary: ports-mgmt/portfmt: portclippy should consider conditional as sub-section
Product: Ports & Packages Reporter: Anton Saietskii <vsasjason>
Component: Individual Port(s)Assignee: Tobias Kortkamp <tobik>
Status: New ---    
Severity: Affects Only Me CC: agh
Priority: --- Flags: bugzilla: maintainer-feedback? (tobik)
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
example Makefile (from net-p2p/tremotesf)
none
portclippy output none

Description Anton Saietskii 2024-04-26 14:17:30 UTC
Currently, it looks like portclippy sorts variables just by their names without taking account a context. This leads to incorrect suggestions to move things around.
Comment 1 Anton Saietskii 2024-04-26 14:19:16 UTC
Created attachment 250239 [details]
example Makefile (from net-p2p/tremotesf)

Here's Makefile example which makes portclippy complaining no matter how we reshuffle variables.
Comment 2 Anton Saietskii 2024-04-26 14:24:03 UTC
Created attachment 250240 [details]
portclippy output

Here's portclippy report for example Makefile. For example, portclippy suggests putting CMAKE_OFF after CMAKE_ARGS, and this isn't possible -- first variable must stay inside '.if' above.

IMO '.if blah ... .else ... .endif' should be considered as independent subsection which in turn can contain at least USE and USES_* variables, probably some others as well.