Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add statix into CI #705

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add statix into CI #705

wants to merge 2 commits into from

Conversation

seberm
Copy link
Contributor

@seberm seberm commented May 27, 2024

Hello,
I have prepared basic support for statix linter and fixed various issues.

For now, I have disabled the repeated_keys and manual_inherit_from warnings in the statix.toml configuration file. I'm not completely sure if it makes sense to fix all of these issues, as it might impact code readability. I have addressed just some of them.

What is your opinion? Thanks.

CC: @erikarvstedt @jonasnick

./modules/electrs.nix>47:3:W:4:This assignment is better written with `inherit`
./modules/electrs.nix>48:3:W:4:This assignment is better written with `inherit`
./modules/electrs.nix>101:7:W:4:This assignment is better written with `inherit`
./modules/presets/secure-node.nix>23:5:W:20:The key `nix-bitcoin` is first assigned here ...
./modules/presets/secure-node.nix>36:5:W:20:... repeated here ...
./modules/presets/secure-node.nix>38:5:W:20:... and here (`1` occurrence omitted). Try `nix-bitcoin = { security.dbusHideProcessInformation=...; onionAddresses.access.${operatorName}=...; nodeinfo.enable=...; }` instead.
./test/lib/make-test.nix>28:9:W:4:This assignment is better written with `inherit`
./test/lib/make-test.nix>29:9:W:4:This assignment is better written with `inherit`
./helper/update-flake.nix>14:5:W:4:This assignment is better written with `inherit`
./modules/lightning-pool.nix>61:5:W:4:This assignment is better written with `inherit`
./modules/lightning-pool.nix>67:3:W:4:This assignment is better written with `inherit`
./modules/lightning-pool.nix>69:3:W:4:This assignment is better written with `inherit`
./modules/lndconnect.nix>148:15:W:4:This assignment is better written with `inherit`
./modules/rtl.nix>178:5:W:20:The key `services` is first assigned here ...
./modules/rtl.nix>179:5:W:20:... repeated here ...
./modules/rtl.nix>180:5:W:20:... and here (`1` occurrence omitted). Try `services = { lnd.enable=...; lightning-loop.enable=...; clightning-rest.enable=...; }` instead.
./modules/backups.nix>96:7:W:20:The key `services` is first assigned here ...
./modules/backups.nix>112:7:W:20:... repeated here ...
./modules/backups.nix>125:7:W:20:... and here. Try `services = { duplicity=...; postgresqlBackup=...; backups.postgresqlDatabases=...; }` instead.
./modules/backups.nix>103:9:W:4:This assignment is better written with `inherit`
./modules/presets/wireguard.nix>44:3:W:4:This assignment is better written with `inherit`
./modules/fulcrum.nix>66:3:W:4:This assignment is better written with `inherit`
./modules/fulcrum.nix>67:3:W:4:This assignment is better written with `inherit`
./modules/fulcrum.nix>135:7:W:4:This assignment is better written with `inherit`
./modules/bitcoind.nix>276:7:W:4:This assignment is better written with `inherit`
./modules/bitcoind.nix>282:3:W:4:This assignment is better written with `inherit`
./modules/bitcoind.nix>441:9:W:4:This assignment is better written with `inherit`
./modules/bitcoind.nix>454:11:W:4:This assignment is better written with `inherit`
./examples/flakes/flake.nix>11:3:W:20:The key `inputs` is first assigned here ...
./examples/flakes/flake.nix>15:3:W:20:... repeated here ...
./examples/flakes/flake.nix>16:3:W:20:... and here. Try `inputs = { nix-bitcoin.url=...; nixpkgs.follows=...; nixpkgs-unstable.follows=...; }` instead.
./modules/presets/bitcoind-remote.nix>5:3:W:4:This assignment is better written with `inherit`
./modules/lnd.nix>146:5:W:4:This assignment is better written with `inherit`
./modules/lnd.nix>151:3:W:4:This assignment is better written with `inherit`
./modules/lnd.nix>155:3:W:4:This assignment is better written with `inherit`
./modules/lnd.nix>158:3:W:4:This assignment is better written with `inherit`
./modules/lnd.nix>291:7:W:4:This assignment is better written with `inherit`
./modules/lnd.nix>296:5:W:20:The key `nix-bitcoin` is first assigned here ...
./modules/lnd.nix>301:5:W:20:... repeated here ...
./modules/lnd.nix>310:5:W:20:... and here. Try `nix-bitcoin = { operator=...; secrets=...; generateSecretsCmds.lnd=...; }` instead.
./examples/krops/deploy.nix>9:3:W:4:This assignment is better written with `inherit`
./examples/qemu-vm/minimal-vm.nix>16:3:W:4:This assignment is better written with `inherit`
./examples/qemu-vm/minimal-vm.nix>28:7:W:20:The key `services` is first assigned here ...
./examples/qemu-vm/minimal-vm.nix>30:7:W:20:... repeated here ...
./examples/qemu-vm/minimal-vm.nix>36:7:W:20:... and here (`1` occurrence omitted). Try `services = { clightning.enable=...; clightning.extraConfig=...; getty.autologinUser=...; }` instead.
./modules/clightning.nix>107:5:W:4:This assignment is better written with `inherit`
./modules/clightning.nix>206:7:W:4:This assignment is better written with `inherit`
./modules/charge-lnd.nix>72:3:W:4:This assignment is better written with `inherit`
./modules/netns-isolation.nix>285:11:W:4:This assignment is better written with `inherit`
./modules/netns-isolation.nix>308:5:W:20:The key `services` is first assigned here ...
./modules/netns-isolation.nix>317:5:W:20:... repeated here ...
./modules/netns-isolation.nix>319:5:W:20:... and here (`13` occurrences omitted). Try `services = { bitcoind=...; clightning.address=...; lnd=...; }` instead.
./modules/netns-isolation.nix>309:7:W:4:This assignment is better written with `inherit`
./modules/netns-isolation.nix>320:7:W:4:This assignment is better written with `inherit`
./modules/netns-isolation.nix>326:7:W:4:This assignment is better written with `inherit`
./modules/lightning-loop.nix>85:5:W:4:This assignment is better written with `inherit`
./modules/lightning-loop.nix>90:3:W:4:This assignment is better written with `inherit`
./modules/lightning-loop.nix>92:3:W:4:This assignment is better written with `inherit`
./modules/lightning-loop.nix>94:3:W:4:This assignment is better written with `inherit`
./dev/dev-scenarios.nix>60:5:W:20:The key `services` is first assigned here ...
./dev/dev-scenarios.nix>62:5:W:20:... repeated here ...
./dev/dev-scenarios.nix>69:5:W:20:... and here. Try `services = { clightning.extraConfig=...; lnd=...; clightning-rest=...; }` instead.
./test/lib/shellcheck-services.nix>77:5:W:4:This assignment is better written with `inherit`
./modules/joinmarket.nix>139:3:W:4:This assignment is better written with `inherit`
./modules/joinmarket.nix>375:9:W:4:This assignment is better written with `inherit`
./modules/clightning-replication.nix>92:3:W:4:This assignment is better written with `inherit`
./modules/clightning-replication.nix>94:3:W:4:This assignment is better written with `inherit`
./modules/clightning-replication.nix>95:3:W:4:This assignment is better written with `inherit`
./modules/clightning-replication.nix>132:5:W:20:The key `systemd` is first assigned here ...
./modules/clightning-replication.nix>140:5:W:20:... repeated here ...
./modules/clightning-replication.nix>155:5:W:20:... and here. Try `systemd = { tmpfiles.rules=...; services.clightning=...; services.clightning-replication-mounts=...; }` instead.
./modules/presets/hardened-extended.nix>17:3:W:20:The key `boot` is first assigned here ...
./modules/presets/hardened-extended.nix>63:3:W:20:... repeated here ...
./modules/presets/hardened-extended.nix>99:3:W:20:... and here. Try `boot = { kernel.sysctl=...; kernelParams=...; blacklistedKernelModules=...; }` instead.
./test/tests.nix>36:7:W:20:The key `tests` is first assigned here ...
./test/tests.nix>42:7:W:20:... repeated here ...
./test/tests.nix>44:7:W:20:... and here (`18` occurrences omitted). Try `tests = { bitcoind=...; clightning=...; trustedcoin=...; }` instead.
./test/tests.nix>37:7:W:20:The key `services` is first assigned here ...
./test/tests.nix>48:7:W:20:... repeated here ...
./test/tests.nix>70:7:W:20:... and here (`7` occurrences omitted). Try `services = { bitcoind=...; clightning.extraConfig=...; rtl=...; }` instead.
./test/tests.nix>43:7:W:20:The key `test` is first assigned here ...
./test/tests.nix>49:7:W:20:... repeated here ...
./test/tests.nix>123:7:W:20:... and here. Try `test = { data.clightning-replication=...; data.clightning-plugins=...; data.btcpayserver-lbtc=...; }` instead.
./test/tests.nix>50:9:W:4:This assignment is better written with `inherit`
./test/tests.nix>129:9:W:4:This assignment is better written with `inherit`
./test/tests.nix>188:7:W:20:The key `services` is first assigned here ...
./test/tests.nix>189:7:W:20:... repeated here ...
./test/tests.nix>195:7:W:20:... and here (`16` occurrences omitted). Try `services = { clightning.enable=...; clightning.replication=...; rtl.enable=...; }` instead.
./test/tests.nix>225:7:W:20:The key `tests` is first assigned here ...
./test/tests.nix>226:7:W:20:... repeated here ...
./test/tests.nix>231:7:W:20:... and here. Try `tests = { secure-node=...; restart-bitcoind=...; stop-electrs=...; }` instead.
./test/tests.nix>243:7:W:20:The key `services` is first assigned here ...
./test/tests.nix>245:7:W:20:... repeated here ...
./test/tests.nix>246:7:W:20:... and here (`10` occurrences omitted). Try `services = { clightning.enable=...; clightning-rest.enable=...; liquidd.enable=...; }` instead.
./test/tests.nix>293:7:W:20:The key `services` is first assigned here ...
./test/tests.nix>305:7:W:20:... repeated here ...
./test/tests.nix>311:7:W:20:... and here (`2` occurrences omitted). Try `services = { bitcoind.regtest=...; lightning-loop.extraConfig=...; lightning-pool.extraConfig=...; }` instead.
./test/wireguard-lndconnect.nix>21:7:W:20:The key `services` is first assigned here ...
./test/wireguard-lndconnect.nix>27:7:W:20:... repeated here ...
./test/wireguard-lndconnect.nix>29:7:W:20:... and here. Try `services = { clightning-rest=...; clightning.extraConfig=...; lnd=...; }` instead.
./modules/versioning.nix>85:9:W:4:This assignment is better written with `inherit`
./modules/versioning.nix>86:9:W:4:This assignment is better written with `inherit`
./modules/mempool.nix>136:7:W:4:This assignment is better written with `inherit`
./modules/mempool.nix>156:3:W:4:This assignment is better written with `inherit`
./modules/mempool.nix>228:5:W:20:The key `services` is first assigned here ...
./modules/mempool.nix>229:5:W:20:... repeated here ...
./modules/mempool.nix>230:5:W:20:... and here (`3` occurrences omitted). Try `services = { bitcoind.txindex=...; electrs.enable=...; fulcrum.enable=...; }` instead.
./modules/mempool.nix>317:51:W:4:This assignment is better written with `inherit`
./modules/mempool.nix>327:7:W:4:This assignment is better written with `inherit`
./test/lib/make-test-vm.nix>4:5:W:4:This assignment is better written with `inherit`
./modules/joinmarket-ob-watcher.nix>40:3:W:4:This assignment is better written with `inherit`
./modules/joinmarket-ob-watcher.nix>106:7:W:4:This assignment is better written with `inherit`
./shell.nix>2:3:W:4:This assignment is better written with `inherit`
./modules/liquid.nix>161:7:W:4:This assignment is better written with `inherit`
./modules/liquid.nix>168:3:W:4:This assignment is better written with `inherit`
./modules/liquid.nix>170:3:W:4:This assignment is better written with `inherit`
./modules/liquid.nix>283:7:W:4:This assignment is better written with `inherit`
./modules/liquid.nix>287:5:W:20:The key `nix-bitcoin` is first assigned here ...
./modules/liquid.nix>289:5:W:20:... repeated here ...
./modules/liquid.nix>290:5:W:20:... and here. Try `nix-bitcoin = { operator.groups=...; secrets.liquid-rpcpassword.user=...; generateSecretsCmds.liquid=...; }` instead.

@seberm seberm marked this pull request as ready for review May 27, 2024 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant