liquidsoap-prettier 1.8.1 → 1.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/.github/workflows/check-formatting.yml +32 -0
  2. package/README.md +31 -5
  3. package/dist/liquidsoap.cjs +4155 -3090
  4. package/package.json +1 -1
  5. package/src/cli.js +104 -9
  6. package/tests/liq/audio.liq +460 -0
  7. package/tests/liq/autocue.liq +1081 -0
  8. package/tests/liq/clock.liq +14 -0
  9. package/tests/liq/cron.liq +74 -0
  10. package/tests/liq/error.liq +48 -0
  11. package/tests/liq/extra/audio.liq +677 -0
  12. package/tests/liq/extra/audioscrobbler.liq +482 -0
  13. package/tests/liq/extra/deprecations.liq +976 -0
  14. package/tests/liq/extra/externals.liq +196 -0
  15. package/tests/liq/extra/fades.liq +260 -0
  16. package/tests/liq/extra/file.liq +66 -0
  17. package/tests/liq/extra/http.liq +160 -0
  18. package/tests/liq/extra/interactive.liq +917 -0
  19. package/tests/liq/extra/metadata.liq +75 -0
  20. package/tests/liq/extra/native.liq +201 -0
  21. package/tests/liq/extra/openai.liq +150 -0
  22. package/tests/liq/extra/server.liq +177 -0
  23. package/tests/liq/extra/source.liq +476 -0
  24. package/tests/liq/extra/spinitron.liq +272 -0
  25. package/tests/liq/extra/telnet.liq +266 -0
  26. package/tests/liq/extra/video.liq +59 -0
  27. package/tests/liq/extra/visualization.liq +68 -0
  28. package/tests/liq/fades.liq +941 -0
  29. package/tests/liq/ffmpeg.liq +605 -0
  30. package/tests/liq/file.liq +387 -0
  31. package/tests/liq/getter.liq +74 -0
  32. package/tests/liq/hls.liq +329 -0
  33. package/tests/liq/http.liq +1048 -0
  34. package/tests/liq/http_codes.liq +447 -0
  35. package/tests/liq/icecast.liq +58 -0
  36. package/tests/liq/io.liq +106 -0
  37. package/tests/liq/liquidsoap.liq +31 -0
  38. package/tests/liq/list.liq +440 -0
  39. package/tests/liq/log.liq +47 -0
  40. package/tests/liq/lufs.liq +295 -0
  41. package/tests/liq/math.liq +23 -0
  42. package/tests/liq/medialib.liq +752 -0
  43. package/tests/liq/metadata.liq +253 -0
  44. package/tests/liq/nfo.liq +258 -0
  45. package/tests/liq/null.liq +71 -0
  46. package/tests/liq/playlist.liq +1347 -0
  47. package/tests/liq/predicate.liq +106 -0
  48. package/tests/liq/process.liq +93 -0
  49. package/tests/liq/profiler.liq +5 -0
  50. package/tests/liq/protocols.liq +1139 -0
  51. package/tests/liq/ref.liq +28 -0
  52. package/tests/liq/replaygain.liq +135 -0
  53. package/tests/liq/request.liq +467 -0
  54. package/tests/liq/resolvers.liq +33 -0
  55. package/tests/liq/runtime.liq +70 -0
  56. package/tests/liq/server.liq +99 -0
  57. package/tests/liq/settings.liq +41 -0
  58. package/tests/liq/socket.liq +33 -0
  59. package/tests/liq/source.liq +362 -0
  60. package/tests/liq/sqlite.liq +161 -0
  61. package/tests/liq/stdlib.liq +172 -0
  62. package/tests/liq/string.liq +476 -0
  63. package/tests/liq/switches.liq +197 -0
  64. package/tests/liq/testing.liq +37 -0
  65. package/tests/liq/thread.liq +161 -0
  66. package/tests/liq/tracks.liq +100 -0
  67. package/tests/liq/utils.liq +81 -0
  68. package/tests/liq/video.liq +918 -0
@@ -0,0 +1,32 @@
1
+ name: Check formatting
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ pull_request:
8
+ merge_group:
9
+
10
+ concurrency:
11
+ group: ${{ github.workflow }}-${{ github.ref }}
12
+ cancel-in-progress: true
13
+
14
+ jobs:
15
+ check:
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+
20
+ - uses: actions/setup-node@v4
21
+ with:
22
+ node-version: lts/*
23
+
24
+ - uses: pnpm/action-setup@v4
25
+ with:
26
+ version: 10
27
+ run_install: true
28
+
29
+ - run: pnpm dev:prepare
30
+
31
+ - name: Check that stdlib files are formatted
32
+ run: node src/cli.js --check 'tests/liq/**/*.liq'
package/README.md CHANGED
@@ -11,18 +11,44 @@ The `liquidsoap-prettier` command-line utility should be installed with this
11
11
  package and should be available following the usual node package binary
12
12
  conventions.
13
13
 
14
- It works as follows:
14
+ Format one or more files in place:
15
15
 
16
16
  ```shell
17
- $ liquidsoap-prettier [-w|--write] path/to/file.liq "path/with/glob/pattern/**/*.liq"
17
+ $ liquidsoap-prettier -w path/to/file.liq "path/with/glob/pattern/**/*.liq"
18
18
  ```
19
19
 
20
- You can also simply check the script without formatting it:
20
+ Print formatted output to stdout (single file only):
21
+
22
+ ```shell
23
+ $ liquidsoap-prettier path/to/file.liq
24
+ ```
25
+
26
+ Read from stdin and write to stdout:
27
+
28
+ ```shell
29
+ $ cat path/to/file.liq | liquidsoap-prettier --stdin-filepath file.liq
30
+ ```
31
+
32
+ Check whether files are already formatted (useful in CI):
33
+
21
34
  ```shell
22
- $ liquidsoap-prettier [-c|--check] path/to/file.liq "path/with/glob/pattern/**/*.liq"
35
+ $ liquidsoap-prettier -c path/to/file.liq "path/with/glob/pattern/**/*.liq"
23
36
  ```
24
37
 
25
- The program returns with exit code `0` when the script is already pretty-printed and `2` otherwise.
38
+ Returns exit code `0` when all files are already formatted, `2` otherwise.
39
+
40
+ Dump the parsed AST as JSON (useful when debugging the printer):
41
+
42
+ ```shell
43
+ $ liquidsoap-prettier --dump-ast path/to/file.liq
44
+ ```
45
+
46
+ Print the version or show all options:
47
+
48
+ ```shell
49
+ $ liquidsoap-prettier --version
50
+ $ liquidsoap-prettier --help
51
+ ```
26
52
 
27
53
  ### Prettier plugin
28
54