Add Periphery unused code workflow - #180
Conversation
|
There was an issue with the PR, but I am normally using periphery by command line. There is also a .periphery.yml on root of project which should be loaded I think? There are several unused properties now, I will clean it in some days, have been busy with some other projects now.. ~/GitHub/RsyncUI/RsyncUI on version-3.0.4
/Users/thomas/GitHub/RsyncUI/RsyncUI/RsyncUI/Model/Execution/EstimateExecute/Estimate.swift:22:9: warning: Unused property 'synchronizeIDwitherror' |
|
@rsyncOSX Which version of periphery are you using? Can you also give me some more details about the false positive? Are you suggesting that Periphery reported |
|
I um using the latest version 3.8.0. Her is a run today, as you see periphery is reporting the lines 52 - 68 as unused. (sorry for the long lines) |
|
It's saying the properties were assigned a value (via the synthesized initializer) but it can't see that the properties are read, because that happens within Codable. So removing the whole struct wasn't the correct interpretation of these results. You can instead resolve this by using the |
|
Hmm, tried adding Also tried the ignore in the heading of the enum, still periphery reports like |

Any interest in detecting unused code in PRs?
This change integrates the Periphery reusable workflow. On pushes to the main branch, it scans for unused code and records a baseline. On PRs, it pulls the baseline for the merge-base commit and then reports any code that’s newly identified as unused.
The results are reported as inline comments in the diff for newly introduced unused code, and also a PR comment which also includes any results that aren’t present in the diff (i.e the change removes the final references to some existing code).
There aren’t any results posted in this PR, because main doesn’t have a baseline yet, and the
run_without_baselineoption is disabled (there are too many results), so it’ll take some time before folks base their PRs onmainand start affecting the code graph.