Skip to content

Commit

Permalink
Merge pull request ubiquity#13 from gitcoindev/rpc-handler-fix-knip-i…
Browse files Browse the repository at this point in the history
…ssues

rpc-handler fix knip issues
  • Loading branch information
rndquu authored May 21, 2024
2 parents e5c4a55 + 759fb4d commit ff31832
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 11 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/knip-reporter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Knip-reporter

on:
workflow_run:
workflows: ["Knip"]
types:
- completed

jobs:
knip-reporter:
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: knip-results
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Read pr number
id: pr-number
uses: juliangruber/read-file-action@v1
with:
path: ./pr-number.txt
trim: true

- name: Report knip results to pull request
if: ${{ github.event.workflow_run.conclusion != 'success' }}
uses: gitcoindev/knip-reporter@main
with:
verbose: true
comment_id: ${{ github.workflow }}-reporter
command_script_name: knip-ci
annotations: true
ignore_results: false
json_input: true
json_input_file_name: knip-results.json
pull_request_number: ${{ steps.pr-number.outputs.content }}
token: ${{ secrets.GITHUB_TOKEN }}
22 changes: 13 additions & 9 deletions .github/workflows/knip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ name: Knip
on:
pull_request:

permissions: write-all

jobs:
run-knip:
runs-on: ubuntu-latest
Expand All @@ -24,11 +22,17 @@ jobs:
- name: Install toolchain
run: yarn install

- name: Report knip results to pull request
uses: Codex-/knip-reporter@v2
- name: Store PR number
run: echo ${{ github.event.number }} > pr-number.txt

- name: Run Knip
run: yarn knip || yarn knip --reporter json > knip-results.json

- name: Upload knip result
if: failure()
uses: actions/upload-artifact@v4
with:
verbose: true
comment_id: ${{ github.workflow }}-reporter
command_script_name: knip-ci
annotations: true
ignore_results: false
name: knip-results
path: |
knip-results.json
pr-number.txt
8 changes: 6 additions & 2 deletions knip.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import type { KnipConfig } from "knip";

const config: KnipConfig = {
entry: ["build/index.ts"],
entry: ["src/index.ts", "src/services/*.ts"],
project: ["src/**/*.ts"],
ignore: ["src/types/config.ts"],
ignoreExportsUsedInFile: true,
ignoreDependencies: [],
ignoreDependencies: ["ts-node", "node-fetch", "eslint-config-prettier", "eslint-plugin-prettier", "@types/jest", "@types/node-fetch"],
jest: {
config: ["jest.config.ts"],
entry: ["tests/*.ts"],
},
};

export default config;

1 comment on commit ff31832

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines Statements Branches Functions
Coverage: 22%
22.4% (2323/10370) 12.95% (632/4877) 20.43% (311/1522)

JUnit

Tests Skipped Failures Errors Time
23 0 💤 0 ❌ 0 🔥 14.203s ⏱️
Coverage Report (22%)
File% Stmts% Branch% Funcs% LinesUncovered Line #s
All files22.412.9520.4322.35 
   index.js22.412.9520.4322.3569, 81, 89–90, 98, 105, 113, 118–120, 123–125, 129, 132, 135, 146, 150, 156–180, 183–238, 241–275, 285, 287, 309–314, 327, 333–345, 348, 351–353, 356–359, 363, 377–383, 505–506, 509, 515, 518, 525–551, 554–562, 565, 568–569, 573, 576–579, 582–590, 593–618, 623–648, 654–676, 680–703, 706–717, 720–729, 732, 735–738, 741–744, 747, 750, 753–756, 759–765, 768–769, 772–774, 777–779, 783–792, 795–796, 799–801, 804–806, 811–827, 830–831, 834–836, 839–841, 844–857, 860, 863–872, 876–915, 919–932, 935–981, 984–1017, 1020–1569, 1572–1609, 1613–1627, 1630–1635, 1638–1645, 1648–1650, 1654–1677, 1684–1690, 1693–1701, 1705–1715, 1718–1730, 1733–1737, 1740–1766, 1769–1771, 1774–1776, 1779, 1784, 1797–1798, 1803, 1806, 1809, 1812–1827, 1830–1857, 1860–1861, 1864–1906, 1909–1910, 1913, 1916, 1919, 1922, 1925–1932, 1935–1950, 1953, 1956–1971, 1974–1984, 1987–2007, 2010, 2013, 2016–2017, 2020, 2023–2050, 2053–2104, 2110–2181, 2184, 2187, 2190, 2193–2202, 2205–2214, 2217, 2220–2231, 2234, 2237–2295, 2302–2354, 2357–2386, 2389, 2392, 2395, 2398, 2401–2422, 2425, 2428–2447, 2450–2457, 2460–2477, 2480, 2483, 2486, 2489, 2492, 2495, 2498, 2501, 2504, 2507, 2510, 2513–2515, 2518–2519, 2522–2523, 2526–2527, 2530–2531, 2534–2535, 2538–2539, 2542–2543, 2546–2547, 2550–2552, 2555–2557, 2560–2562, 2565–2567, 2570–2572, 2575–2577, 2580–2582, 2585–2587, 2596–2600, 2603–2605, 2608–2629, 2632, 2635–2638, 2646–2669, 2673–2692, 2700, 2708, 2716–2727, 2730–2755, 2759–2760, 2763–2764, 2770–2773, 2776–2779, 2782–2787, 2790–2795, 2798–2803, 2806–2811, 2814–2815, 2818–2819, 2822–2823, 2826, 2829, 2832–2871, 2874–2879, 2883–2923, 2926–2927, 2930–2932, 2935–2948, 2952, 2955–2957, 2960–2974, 2977–2988, 2991–2992, 3010, 3016–3017, 3086–3087, 3091–3092, 3097, 3102, 3107, 3112, 3125, 3128, 3135, 3138, 3146–3149, 3153, 3161, 3164, 3208–3275, 3278–3294, 3297–3334, 3337–3345, 3348–3364, 3367–3390, 3393–3415, 3419–3449, 3453–3454, 3458–3630, 3636–3641, 3656–3657, 3660–3661, 3686–3693, 3710–3757, 3761–3764, 3768–3769, 3773–3780, 3784–3787, 3791–3806, 3810–3821, 3825–3840, 3844, 3848, 3852, 3856, 3860, 3864, 3868–3873, 3877–3879, 3883–3884, 3888–3897, 3901–3902, 3906–3917, 3921–3922, 3926–3927, 3931–3932, 3936, 3940–3941, 3956–3964, 3968–3984, 3987–3989, 3992–4023, 4037–4042, 4046, 4050, 4054, 4058, 4062, 4066, 4070, 4097–4107, 4116–4139, 4142–4145, 4237–4251, 4260–4293, 4296–4299, 4313–4316, 4334–4337, 4526–4548, 4557–4579, 4592–4676, 4679–4778, 4792–4795, 4821–4824, 4857–4861, 4870–4911, 4914–4953, 5295–5302, 5306–5316, 5319–5320, 5323–5324, 5360, 5366–5504, 5521, 5523–5528, 5530–5532, 5592–5596, 5645–5649, 5653, 5656–5659, 5704–5873, 5878, 5880–5915, 5935–5942, 5949, 5952, 5955, 5958, 5963, 5973–5982, 5985, 5988, 5991–6005, 6010–6043, 6050, 6056–6107, 6111, 6115–6155, 6159, 6161, 6164, 6172–6280, 6297, 6306–6437, 6443, 6447, 6456, 6460, 6463, 6467–6495, 6505, 6509, 6517, 6523, 6528–6545, 6560–6582, 6598–6624, 6637–6681, 6685–6686, 6699–6721, 6727, 6736–6761, 6777, 6781–6841, 6844, 6850–6853, 6856, 6943, 6957–6992, 7020–7025, 7042–7096, 7134, 7171–7195, 7203–7319, 7574–7664, 7672–7716, 7740–7844, 7855–7873, 7880, 7891–7941, 7947–7969, 7980–7985, 8005–8008, 8015–8097, 8101–8363, 8386, 8403–8476, 8488–8510, 8515–8862, 8896–8901, 8905–8906, 8909–8910, 8916–8943, 8947–8950, 8954–8957, 8961–8964, 8976–8995, 8999–9044, 9048–9050, 9055, 9059, 9067–9085, 9090, 9093, 9096–9122, 9125–9153, 9156–9277, 9281, 9284, 9287–9302, 9305, 9308–9312, 9315, 9318–9329, 9332–9337, 9340–9349, 9355–9362, 9368, 9371–9374, 9392–9399, 9406–9414, 9419–9452, 9459–9465, 9468–9522, 9528–9539, 9542–9552, 9555–9561, 9564–9607, 9612, 9615, 9618–9642, 9645–9647, 9659–9679, 9682–9684, 9687, 9690–9705, 9708–9719, 9722, 9725, 9728–9736, 9739–9744, 9747–9752, 9755, 9758–9777, 9780–9802, 9806, 9809–9815, 9818, 9821–9845, 9848–9871, 9874–9911, 9914–9921, 9927–9957, 9963–9994, 9997–10016, 10019–10048, 10051–10052, 10055–10065, 10068–10080, 10084–10086, 10089, 10106–10116, 10124–10130, 10272–10289, 10293–10302, 10305, 10308–10316, 10319–10331, 10334–10353, 10357–10363, 10367–10369, 10375–10377, 10383–10390, 10393–10401, 10404–10407, 10410–10411, 10414–10423, 10426–10429, 10432, 10435, 10438, 10442–10452, 10456–10488, 10491–10552, 10555–10575, 10580, 10585–10602, 10606, 10609, 10612, 10615–10632, 10636–10642, 10645–10685, 10689–10711, 10714–10731, 10734–10747, 10757, 10776–10779, 10783–10844, 10861–11102, 11125, 11231–11472, 11477–11480, 11486–11489, 11495–11502, 11510–11532, 11538–11576, 11583, 11588–11603, 11609–11651, 11663–11666, 11676–11731, 11736–12030, 12054, 12057–12060, 12068, 12078–12116, 12132–13235, 13242–13253, 13256, 13261–13317, 13337–13359, 13388–13604, 13611–13633, 13639–13756, 13761–13936, 13942–13954, 13977–13982, 13989, 13996, 14001–14264, 14319, 14350, 14355, 14387, 14396, 14400, 14421–14424, 14441, 14457–14463, 14466–14477, 14481, 14485–14490, 14495–14499, 14526, 14536–14538, 14556, 14566–14574, 14577–14596, 14683, 14694, 14756–14770, 14776–14865, 14871–14886, 14890, 14893–14897, 14904, 14910–14925, 14944–14971, 14986–14987, 15081–15087, 15096–15144, 15155–15160, 15170, 15174, 15177, 15180, 15183–15184, 15188–15193, 15204, 15211, 15220–15223, 15284–15305, 15320–15326, 15330–15347, 15370, 15381, 15400–15452, 15460–15462, 15466, 15474, 15484–15490, 15523, 15592–15593, 15604–15633, 15642–15660, 15669–15689, 15704–15728, 15735, 15747–15768, 15783, 15790, 15796, 15890, 15897–15901, 15905–15909, 15919–16036, 16085–16095, 16099–16100, 16104–16121, 16130–16131, 16160, 16165, 16170–16186, 16190–16191, 16220–16230, 16237, 16251–16256, 16323, 16332–16336, 16352, 16410, 16414, 16420–16421, 16433, 16444, 16448–16449, 16486, 16498–16499, 16513–16518, 16539–16543, 16547, 16553–16561, 16567–16573, 16579, 16584, 16589–16591, 16596, 16627, 16637–16641, 16645–16652, 16656, 16674–16681, 16691–16705, 16717–16718, 16726, 16823, 16907–16917, 16927–16951, 16957, 16964, 16999, 17001, 17004, 17014–17015, 17021, 17026–17027, 17030, 17036, 17041–17050, 17056–17062, 17068–17071, 17095, 17098, 17101, 17110–17112, 17124–17130

Please sign in to comment.