Bug 278591 - ports-mgmt/portfmt: portclippy should consider conditional as sub-section
Summary: ports-mgmt/portfmt: portclippy should consider conditional as sub-section
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Tobias Kortkamp
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-26 14:17 UTC by Anton Saietskii
Modified: 2024-04-28 23:04 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (tobik)


Attachments
example Makefile (from net-p2p/tremotesf) (1.04 KB, text/plain)
2024-04-26 14:19 UTC, Anton Saietskii
no flags Details
portclippy output (510 bytes, text/plain)
2024-04-26 14:24 UTC, Anton Saietskii
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.