platformos-check 0.4.12 → 0.4.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +6 -0
  3. data/CONTRIBUTING.md +20 -18
  4. data/README.md +108 -57
  5. data/RELEASING.md +14 -7
  6. data/TROUBLESHOOTING.md +19 -10
  7. data/data/platformos_liquid/documentation/filters.json +1 -1
  8. data/data/platformos_liquid/documentation/latest.json +1 -1
  9. data/data/platformos_liquid/documentation/tags.json +1 -1
  10. data/docs/api/check.md +7 -6
  11. data/docs/api/html_check.md +12 -13
  12. data/docs/api/liquid_check.md +17 -21
  13. data/docs/api/yaml_check.md +3 -3
  14. data/docs/checks/TEMPLATE.md.erb +16 -11
  15. data/docs/checks/convert_include_to_render.md +29 -13
  16. data/docs/checks/deprecated_filter.md +5 -9
  17. data/docs/checks/form_action.md +12 -12
  18. data/docs/checks/form_authenticity_token.md +21 -15
  19. data/docs/checks/graphql_in_for_loop.md +15 -13
  20. data/docs/checks/html_parsing_error.md +12 -12
  21. data/docs/checks/img_lazy_loading.md +13 -11
  22. data/docs/checks/img_width_and_height.md +21 -23
  23. data/docs/checks/include_in_render.md +11 -11
  24. data/docs/checks/invalid_args.md +11 -11
  25. data/docs/checks/liquid_tag.md +12 -12
  26. data/docs/checks/missing_enable_comment.md +7 -7
  27. data/docs/checks/missing_template.md +14 -13
  28. data/docs/checks/parse_json_format.md +15 -14
  29. data/docs/checks/parser_blocking_javascript.md +19 -14
  30. data/docs/checks/required_layout_object.md +5 -7
  31. data/docs/checks/space_inside_braces.md +12 -12
  32. data/docs/checks/syntax_error.md +10 -10
  33. data/docs/checks/template_length.md +12 -12
  34. data/docs/checks/translation_files_match.md +10 -11
  35. data/docs/checks/translation_key_exists.md +10 -11
  36. data/docs/checks/undefined_object.md +11 -13
  37. data/docs/checks/unknown_filter.md +11 -11
  38. data/docs/checks/unreachable_code.md +11 -11
  39. data/docs/checks/unused_assign.md +11 -11
  40. data/docs/checks/unused_partial.md +7 -11
  41. data/docs/checks/valid_yaml.md +11 -11
  42. data/docs/language_server/how_to_correct_code_with_code_actions_and_execute_command.md +62 -70
  43. data/lib/platformos_check/language_server/handler.rb +6 -6
  44. data/lib/platformos_check/language_server/variable_lookup_finder.rb +8 -10
  45. data/lib/platformos_check/platformos_liquid/documentation.rb +2 -2
  46. data/lib/platformos_check/version.rb +1 -1
  47. data/platformos-check.gemspec +1 -1
  48. metadata +5 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c5795a4dfbd11ce9650dd968756ebf8762eab1528fc41a2bb968eeb6b7bfc061
4
- data.tar.gz: ba6029d4a33bd1d91e600ec33aeebd9de2660567188073dfe64db36b39415ea7
3
+ metadata.gz: c3d6f6042c319fcddd4ffcfd7448d2f1fa23f77e7f10839b1cc77b667bfe5b13
4
+ data.tar.gz: b151f8a69281c760f476ac5d1e849a079691f2607f54093e03f3dd64e7b985aa
5
5
  SHA512:
6
- metadata.gz: ffa173e4a4441e4d49da110129c3c964c74c2b011da9d45e4b51f4385eec43d2aa374f03754c048ec58ff8e934924f38b36f94bfd4a61e3b873324a489886ed5
7
- data.tar.gz: 7c96d26c1b529b670fa316dd7202f23888dd6ffd711d9249a14bfbea516528ca9793ff3a44a80e1b032b682080bf99d190e6a11d8c8a56f2a84b236a025bd9af
6
+ metadata.gz: 377ff80d76ac4a465bca202d949193ea7b4f836df04068be7eece864eb74e17823e008f983831cd8e259a532e3c1b93d83b210480c3c1ebb8440e113598ce498
7
+ data.tar.gz: 34c02ebc74de8ac8d9bd193f502b7ebef6de635df4eb87bdb3a2454bafab841896008a8b5e67a8057ec770b08d9fad5f1e9a24e056bed65f7699c1d819ea9839
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ v0.4.13 / 2024-10-07
2
+ ==================
3
+
4
+ * Lock liquid version
5
+ * Fix rubocop warnings
6
+
1
7
  v0.4.12 / 2024-04-13
2
8
  ==================
3
9
 
data/CONTRIBUTING.md CHANGED
@@ -6,16 +6,16 @@
6
6
  * PR should explain what the feature does, and why the change exists.
7
7
  * PR should include any carrier specific documentation explaining how it works.
8
8
  * Code _must_ be tested.
9
- * Be consistent. Write clean code that follows [Ruby community standards](https://github.com/bbatsov/ruby-style-guide).
9
+ * Be consistent. Write clean code that follows the [Ruby community standards](https://github.com/bbatsov/ruby-style-guide).
10
10
  * Code should be generic and reusable.
11
11
 
12
12
  ## How to contribute
13
13
 
14
- 1. Fork it ( https://github.com/Platform-OS/platformos-lsp )
15
- 2. Create your feature branch (`git checkout -b my-new-feature`)
16
- 3. Commit your changes (`git commit -am 'Add some feature'`)
17
- 4. Push to the branch (`git push origin my-new-feature`)
18
- 5. Create a new Pull Request
14
+ 1. Fork it (https://github.com/Platform-OS/platformos-lsp).
15
+ 2. Create your feature branch (`git checkout -b my-new-feature`).
16
+ 3. Commit your changes (`git commit -am 'Add some feature'`).
17
+ 4. Push to the branch (`git push origin my-new-feature`).
18
+ 5. Create a new Pull Request.
19
19
 
20
20
  ## Run Language Server
21
21
 
@@ -49,9 +49,9 @@ Before configuring your IDE, run the following commands in a terminal:
49
49
 
50
50
  #### Configure VS Code
51
51
 
52
- 1. Download provided .vsix file
53
- 2. Install it manually via View -> Extensions -> ... -> Install from VSIX
54
- 3. Configure settings.json
52
+ 1. Download provided `.vsix` file.
53
+ 2. Install it manually via View -> Extensions -> ... -> Install from VSIX.
54
+ 3. Configure `settings.json`:
55
55
 
56
56
  ```
57
57
  "platformosCheck.checkOnChange": true,
@@ -90,8 +90,8 @@ If you use `coc.nvim` as your completion engine, add this to your CocConfig:
90
90
 
91
91
  ### Confirm Setup
92
92
 
93
- * In another terminal from the root of theme check run `tail -f /tmp/platformos-check-debug.log` to watch the server logs
94
- * Restart your IDE, confirm the response for initialize in the logs is pointing to the language server in the `$HOME/bin` directory (the version will be different)
93
+ * From the root of platformos-check, run `tail -f /tmp/platformos-check-debug.log` in another terminal to watch the server logs.
94
+ * Restart your IDE, confirm the response for initialization in the logs is pointing to the language server in the `$HOME/bin` directory (the version will be different).
95
95
 
96
96
  ```json
97
97
  "serverInfo": {
@@ -118,9 +118,9 @@ bin/platformos-check /path/to/your/app
118
118
 
119
119
  Run `bundle exec rake "new_check[MyNewCheckName]"` to generate all the files required to create a new check.
120
120
 
121
- Check the [Check API](/docs/api/check.md) for how to implement a check. Also take a look at other checks in [lib/platformos_check/checks](/lib/platformos_check/checks).
121
+ Check the [Check API](/docs/api/check.md) for how to implement a check. Also, take a look at other checks in [lib/platformos_check/checks](/lib/platformos_check/checks).
122
122
 
123
- We done implementing your check, add it to `config/default.yml` to enable it:
123
+ When you're done implementing your check, add it to `config/default.yml` to enable it:
124
124
 
125
125
  ```yaml
126
126
  MyNewCheckName:
@@ -128,7 +128,9 @@ MyNewCheckName:
128
128
  ignore: []
129
129
  ```
130
130
 
131
- If the check is configurable, the `initialize` argument names and default values should also be duplicated inside `config/default.yml`. eg.:
131
+ If the check is configurable, the `initialize` argument names and default values should also be duplicated inside `config/default.yml`.
132
+
133
+ For example:
132
134
 
133
135
  ```ruby
134
136
  class MyCheckName < LiquidCheck
@@ -148,9 +150,9 @@ MyNewCheckName:
148
150
 
149
151
  ## Debugging
150
152
 
151
- A couple of things are turned on when the `PLATFORMOS_CHECK_DEBUG` environment variable is set.
153
+ When the `PLATFORMOS_CHECK_DEBUG` environment variable is set, several features are enabled:
152
154
 
153
- 1. The check timeout is turned off. This means you can add `binding.pry` in tests and properly debug with `bundle exec rake tests:in_memory`
155
+ 1. The check timeout is disabled. This allows you to use `binding.pry` in tests and debug with `bundle exec rake tests:in_memory`.
154
156
  2. The `--profile` flag appears. You can now create Flamegraphs to inspect performance.
155
157
 
156
158
  ```
@@ -173,7 +175,7 @@ bin/platformos-check-language-server
173
175
 
174
176
  #### Flamegraph
175
177
 
176
- With the `--profile` flag, you can run platformos-check on a theme and the `ruby-prof-flamegraph` printer will output profiling information in a format [Flamegraph](/brendangregg/FlameGraph) understands.
178
+ With the `--profile` flag, you can run platformos-check on your platformOS application and the `ruby-prof-flamegraph` printer will output profiling information in a format [Flamegraph](/brendangregg/FlameGraph) understands.
177
179
 
178
180
 
179
181
  **Setup:**
@@ -206,4 +208,4 @@ What you'll see is an interactive version of the following image:
206
208
 
207
209
  ## Troubleshooting
208
210
 
209
- If you run into issues during development, see the [troubleshooting guide](/TROUBLESHOOTING.md)
211
+ If you run into issues during development, see the [Troubleshooting Guide](/TROUBLESHOOTING.md).
data/README.md CHANGED
@@ -1,18 +1,27 @@
1
- # platformOS Check ✅ - A linter for platformOS
1
+ # platformOS Check ✅ - A Linter for platformOS
2
2
 
3
- PlatformOS Check is a tool that helps you follow platformOS recommendations & best practices by analyzing the Liquid inside your app.
3
+ PlatformOS Check is a tool that checks your app’s Liquid code to make sure it follows the recommended best practices for [platformOS](https://www.platformos.com/).
4
+ This tool looks for common errors and areas where your code could be improved, helping you clean up and optimize your code by pointing out syntax mistakes, outdated elements, and performance issues.
4
5
 
5
- ![](docs/preview.png)
6
+ ![](docs/platformos-check.jpg)
6
7
 
7
8
  ## Supported Checks
8
9
 
9
- PlatformOS Check currently checks for the following:
10
+ PlatformOS Check currently performs the following checks:
11
+
12
+ **Syntax Validation:**
10
13
 
11
14
  ✅ Liquid syntax errors
12
15
  ✅ JSON syntax errors
13
- ✅ Missing partials and graphqls
14
- Unused variables (via `{% assign var = ... %}`, {% function var = ... %} etc.)
16
+
17
+ **Resource Verification:**
18
+
19
+ ✅ Missing partials and GraphQL files
20
+ ✅ Unused variables (using `{% assign var = ... %}`, {% function var = ... %} and similar tags)
15
21
  ✅ Unused partials
22
+
23
+ **Code Efficiency and Quality:**
24
+
16
25
  ✅ Template length
17
26
  ✅ Deprecated tags
18
27
  ✅ Unknown tags
@@ -22,57 +31,70 @@ PlatformOS Check currently checks for the following:
22
31
  ✅ Undefined objects
23
32
  ✅ Deprecated filters
24
33
  ✅ Missing `platformos-check-enable` comment
25
- ✅ Invalid arguments provided to `{% graphql %}` tags
34
+ ✅ Invalid arguments in `{% graphql %}` tags
26
35
  ✅ Missing `authenticity_token` in `<form>`
27
36
  ✅ Unreachable code
28
37
 
29
- As well as checks that prevent easy to spot performance problems:
38
+ **Performance Optimization:**
30
39
 
31
- ✅ [GraphQL in for loop](/docs/checks/graphql_in_for_loop.md)
32
- Use of [parser-blocking](/docs/checks/parser_blocking_javascript.md) JavaScript
33
- ✅ [Missing width and height attributes on `img` tags](/docs/checks/img_width_and_height.md)
40
+ Preventing the [use of GraphQL queries inside loops](/docs/checks/graphql_in_for_loop.md)
41
+ Identifying [parser-blocking JavaScript](/docs/checks/parser_blocking_javascript.md)
42
+ Ensuring `img` tags have [width and height attributes to improve loading times](/docs/checks/img_width_and_height.md)
34
43
 
35
- For detailed descriptions and configuration options, [take a look at the complete list.](/docs/checks/)
44
+ For detailed descriptions and configuration options, [take a look at the complete list of checks](/docs/checks/).
36
45
 
37
- With more to come! Suggestions welcome ([create an issue](https://github.com/Platform-OS/platformos-lsp/issues)).
46
+ We continually update and expand our checks. If you have suggestions, please [let us know by creating an issue](https://github.com/Platform-OS/platformos-lsp/issues).
38
47
 
39
48
  ## Installation
40
49
 
41
- - download and install the extension [more]
42
- - next steps
43
- -> [using-local-ruby]
44
- -> [docker]
50
+ - Download and [install the platformOS Liquid extension](https://marketplace.visualstudio.com/items?itemName=platformOS.platformos-check-vscode)
51
+ - Choose your installation method for Ruby and platformos-check gem:
52
+ * [Using Locally Installed Ruby](#using-locally-installed-ruby)
53
+ * [Using Docker](#using-docker)
45
54
 
46
- ### Using locally installed ruby
55
+ ### Using Locally Installed Ruby
47
56
 
48
57
  #### Requirements
49
58
 
50
59
  - Ruby 3.2+
51
60
 
52
- ### Install ruby and platform-check gem
61
+ ### Install Ruby and platformos-check gem
62
+
63
+ ⚠️ **Note:** Please make sure you install Ruby and the gem for your user and not as root to avoid permission issues. Install without using `sudo`.
53
64
 
54
- 1. Download the latest version of Ruby - https://www.ruby-lang.org/en/documentation/installation/
65
+ 1. Download and install Ruby version 3.2 or higher using the [Official Ruby documentation](https://www.ruby-lang.org/en/documentation/installation/).
55
66
 
56
- Verify that you've installed at least version 3.2:
67
+ Ensure your Ruby is 3.2 or higher:
68
+
69
+ ```
70
+ ruby -v
71
+ ```
57
72
 
58
- `ruby -v`
73
+ ⚠️ **Note:** Restart your terminal after installation.
59
74
 
60
- ⚠️ **Note:** You might need to restart the terminal after installing.
61
- ⚠️ **Note:*** Please make sure you install ruby for your user, not the root
75
+ 2. Install platformos-check gem, using:
62
76
 
63
- 2. Install platformos-check gem
77
+ ```
78
+ gem install platformos-check
79
+ ```
64
80
 
65
- `gem install platformos-check`
81
+ Confirm the installation was successful by checking the version:
66
82
 
67
- You can verify the installation was successful by invoking `platformos-check --version`. If you chose this method, use `platformos-check-language-server` as a path to your language server instead of `/Users/<username/platformos-check-language-server`
83
+ ```
84
+ platformos-check --version
85
+ ```
68
86
 
69
- ⚠️ **Note:*** Please make sure you install the gem for your user, not the root - i.e. without `sudo`
87
+ If you chose this method, use `platformos-check-language-server` as a path to your language server instead of `/Users/<username/platformos-check-language-server`.
70
88
 
71
89
  ### Using Docker
72
90
 
73
- #### PlatformOS Check Language Server
91
+ To set up the PlatformOS Check Language Server using Docker, follow these steps:
92
+
93
+ #### platformOS Check Language Server
74
94
 
75
- - Create an executable `platformos-check-language-server` file and place it within a directory listed in your $PATH variable.
95
+ 1. Create a file named `platformos-check-language-server` and ensure it's executable and placed within a directory listed in your $PATH variable.
96
+
97
+ 2. Use the following script:
76
98
 
77
99
  ```bash
78
100
  DIR=$(pwd)
@@ -89,15 +111,18 @@ exec docker run -i \
89
111
  -e PLATFORMOS_CHECK_DEBUG_LOG_FILE=$LOG_FILE \
90
112
  $IMAGE_NAME $@
91
113
  ```
92
- This script will automatically download the latest Docker image and initiate a language server. Visual Studio Code (VSC) manages this process automatically. However, you can run the script for verification if needed.
114
+
115
+ This script downloads the latest Docker image and starts the language server. Visual Studio Code (VS Code) can manage this process automatically, but you can also run the script manually for verification if needed.
93
116
 
94
117
  #### Troubleshooting
95
118
 
96
- - In the event of `onlySingleFileChecks: true` not functioning as expected, please examine your Visual Studio Code (VSC) workspace. Ensure that the workspace contains only a single project.
119
+ - If the `onlySingleFileChecks: true` setting does not work as expected, check your Visual Studio Code (VS Code) workspace settings. Ensure that the workspace contains only a single project.
97
120
 
98
- #### PlatformOS Check
121
+ #### PlatformOS Check as a Standalone Function
99
122
 
100
- PlatformOS Check can be used also as a standalone function. Prepare the following executable script:
123
+ PlatformOS Check can also be used as a standalone function.
124
+
125
+ 1. Prepare and run the following script to set up the Docker environment:
101
126
 
102
127
  ```bash
103
128
  DIR=$(pwd)
@@ -114,22 +139,32 @@ exec docker run -i \
114
139
  -e PLATFORMOS_CHECK_DEBUG_LOG_FILE=$LOG_FILE \
115
140
  $IMAGE_NAME $@
116
141
  ```
117
- To verify installation run `platformos-check --help`.
118
142
 
119
- Usage example for CI/CD:
143
+ 2. To check if the tool is correctly installed up, run:
144
+
145
+ ```
146
+ platformos-check --help
147
+ ```
148
+
149
+ **Usage example for CI/CD:**
150
+
120
151
  ```
121
152
  platformos-check --fail-level error
122
153
  ```
123
154
 
155
+ This setting ensures that the CI process will fail if any errors are detected during the checks.
156
+
124
157
  ## Configuration
125
158
 
126
- Add a `.platformos-check.yml` file at the root of your app.
159
+ To configure PlatformOS Check according to your project's needs, you create a `.platformos-check.yml` file in the root directory of your application.
160
+
161
+ See [config/default.yml](config/default.yml) for available options and their default values.
127
162
 
128
- See [config/default.yml](config/default.yml) for available options & defaults.
163
+ ## Disable Checks with Comments
129
164
 
130
- ## Disable checks with comments
165
+ Control the behavior of PlatformOS Check within your Liquid templates using comments to disable and re-enable checks as needed.
131
166
 
132
- Use Liquid comments to disable and re-enable all checks for a section of your file:
167
+ ### Temporarily Disabling All Checks
133
168
 
134
169
  ```liquid
135
170
  {% # platformos-check-disable %}
@@ -137,7 +172,11 @@ Use Liquid comments to disable and re-enable all checks for a section of your fi
137
172
  {% # platformos-check-enable %}
138
173
  ```
139
174
 
140
- Disable a specific check by including it in the comment:
175
+ All checks will be ignored between the `disable` and `enable` comments.
176
+
177
+ ### Disabling a Specific Check
178
+
179
+ To disable a specific check, such as `UnusedAssign`, include the check's name in the comment:
141
180
 
142
181
  ```liquid
143
182
  {% # platformos-check-disable UnusedAssign %}
@@ -145,7 +184,9 @@ Disable a specific check by including it in the comment:
145
184
  {% # platformos-check-enable UnusedAssign %}
146
185
  ```
147
186
 
148
- Disable multiple checks by including them as a comma-separated list:
187
+ ### Disabling Multiple Checks
188
+
189
+ To disable multiple checks simultaneously, list them in a comma-separated format within the comments:
149
190
 
150
191
  ```liquid
151
192
  {% # platformos-check-disable UnusedAssign,SpaceInsideBraces %}
@@ -153,7 +194,9 @@ Disable multiple checks by including them as a comma-separated list:
153
194
  {% # platformos-check-enable UnusedAssign,SpaceInsideBraces %}
154
195
  ```
155
196
 
156
- Disable checks for the _entire document_ by placing the comment on the first line:
197
+ ### Disabling Checks for the Entire Document
198
+
199
+ To disable a check throughout the entire document, place the disabling comment in the first line:
157
200
 
158
201
  ```liquid
159
202
  {% # platformos-check-disable SpaceInsideBraces %}
@@ -162,9 +205,9 @@ Disable checks for the _entire document_ by placing the comment on the first lin
162
205
 
163
206
  ## Exit Code and `--fail-level`
164
207
 
165
- Use the `--fail-level` (default: `error`) flag to configure the exit code of platformos-check. Useful in CI scenarios.
208
+ Configure the exit code of platformos-check using the `--fail-level` (default: `error`) flag, which is especially useful in continuous integration (CI) scenarios. This flag helps you control at what severity level checks should cause your CI process to fail.
166
209
 
167
- Example:
210
+ ### Usage Examples
168
211
 
169
212
  ```
170
213
  # Make CI fail on styles warnings, suggestions, and errors
@@ -177,19 +220,23 @@ platformos-check --fail-level suggestion path_to_app
177
220
  platformos-check path_to_app
178
221
  ```
179
222
 
223
+ ### Fail Levels
224
+
180
225
  There are three fail levels:
181
226
 
182
227
  - `error`
183
228
  - `suggestion`
184
229
  - `style`
185
230
 
186
- Exit code meanings:
231
+ ### Exit Code Meanings
232
+
233
+ - 0: Success — no issues found.
234
+ - 1: Your code does not pass the specified fail level of checks.
235
+ - 2: Error in platformos-check itself — indicates a bug within the tool.
187
236
 
188
- - 0: Success!
189
- - 1: Your code doesn't pass the checks
190
- - 2: There's a bug in platformos-check
237
+ ### Customizing Check Severity
191
238
 
192
- If you would like to change the severity of a check, you can do so with the `severity` attribute. Example:
239
+ You can adjust the severity of specific checks using the `severity` attribute in your configuration file:
193
240
 
194
241
  ```yaml
195
242
  DeprecateLazysizes:
@@ -197,17 +244,21 @@ DeprecateLazysizes:
197
244
  severity: error
198
245
  ```
199
246
 
247
+ This configuration, for example, treats the "DeprecateLazysizes" check as an error, thus influencing the exit code according to the `--fail-level` set.
248
+
200
249
  ## Language Server Configurations
201
250
 
202
- - `platformosCheck.checkOnOpen` (default: `true`) makes it so theme check runs on file open.
203
- - `platformosCheck.checkOnChange` (default: `true`) makes it so theme check runs on file change.
204
- - `platformosCheck.checkOnSave` (default: `true`) makes it so theme check runs on file save.
205
- - `platformosCheck.onlySingleFileChecks` (default: `false`) makes it so we only check the opened files and disable "whole application" checks (e.g. UnusedPartial, TranslationKeyExists)
251
+ Configure the PlatformOS Check language server to optimize how it interacts with your files in the development environment. The following settings can be adjusted in your editor's configuration file.
252
+
253
+ In VS Code, you can set it directly in your `settings.json` file.
206
254
 
207
- ⚠️ **Note:** Quickfixes only work on a freshly checked file. If any of those configurations are turned off, you will need to rerun platformos-check in order to apply quickfixes.
255
+ - `platformosCheck.checkOnOpen` (default: `true`): Automatically runs checks when a file is opened.
256
+ - `platformosCheck.checkOnChange` (default: `true`): Executes checks whenever changes are made to a file.
257
+ - `platformosCheck.checkOnSave` (default: `true`): Initiates checks every time a file is saved.
258
+ - `platformosCheck.onlySingleFileChecks` (default: `false`): Limits checks to the currently opened file, excluding checks that involve the entire application such as `UnusedPartial` or `TranslationKeyExists`.
208
259
 
209
- In VS Code, these can be set directly in your `settings.json`.
260
+ ⚠️ **Note:** Quickfixes only work on files that have been recently checked. If you have disabled the automatic checking configurations, you need to manually rerun platformos-check to enable quickfixes.
210
261
 
211
262
  ## Contributing
212
263
 
213
- For guidance on contributing, refer to this [doc](/CONTRIBUTING.md)
264
+ We welcome contributions from the community! For detailed guidance on how to contribute, please refer to our [contribution guidelines](/CONTRIBUTING.md). Your input helps us make the tool better for everyone.
data/RELEASING.md CHANGED
@@ -1,17 +1,23 @@
1
1
  ## Releasing platformOS Check
2
2
 
3
- 1. Check the Semantic Versioning page for info on how to version the new release: http://semver.org
3
+ Follow these steps to release a new version of latformOS Check:
4
4
 
5
- 2. Run the following command to update the version in `lib/platformos_check/version.rb` and replace the `PLATFORMOS_CHECK_VERSION` placeholder in the documentation for new rules:
5
+ 1. **Versioning**: Refer to the [Semantic Versioning page](http://semver.org) to determine the appropriate version number for the new release based on the changes made.
6
+
7
+ 2. **Update Version**: Update the version number in the `lib/platformos_check/version.rb` file. Also, replace the `PLATFORMOS_CHECK_VERSION` placeholder in the documentation for any new rules.
8
+ Use the following command to automate these updates:
6
9
 
7
10
  ```bash
8
11
  VERSION="X.X.X"
9
12
  rake prerelease[$VERSION]
10
13
  ```
11
14
 
12
- 3. Run [`git changelog`](https://github.com/tj/git-extras) to update `CHANGELOG.md`.
15
+ 3. **Update Changelog**: Use the [`git changelog` command](https://github.com/tj/git-extras) to automatically update the `CHANGELOG.md` with the latest commit descriptions.
16
+ ```bash
17
+ git changelog
18
+ ```
13
19
 
14
- 4. Commit your changes and make a PR.
20
+ 4. **Commit and Prepare PR**: Commit the changes and prepare a pull request for review.
15
21
 
16
22
  ```bash
17
23
  git checkout -b "bump/platformos-check-$VERSION"
@@ -20,9 +26,10 @@
20
26
  hub compare "main:bump/platformos-check-$VERSION"
21
27
  ```
22
28
 
23
- 5. Merge your PR to main.
29
+ 5. **Merge PR**: After review, merge your pull request into the main branch.
30
+
31
+ 6. **Create GitHub Release**: [Create a GitHub release](https://github.com/Platform-OS/platformos-lsp/releases/new) for the change using the updated version tag.
24
32
 
25
- 6. [Create a GitHub release](https://github.com/Platform-OS/platformos-lsp/releases/new) for the change.
26
33
 
27
34
  ```
28
35
  VERSION=v1.X.Y
@@ -32,4 +39,4 @@
32
39
  gh release create -t $VERSION
33
40
  ```
34
41
 
35
- (It's a good idea to copy parts of the CHANGELOG in there)
42
+ ⚠️ **Note:** Incorporate relevant parts of the CHANGELOG into the release notes to provide context on the changes.
data/TROUBLESHOOTING.md CHANGED
@@ -2,34 +2,43 @@
2
2
 
3
3
  ## Issues with Language Server
4
4
 
5
- ### Language server erroring out on startup
5
+ ### Language Server Crashing on Startup
6
6
 
7
- The following error can cause language server to crash:
7
+ The following error can cause Language Server to crash:
8
+
9
+ **Error Message:**
8
10
  ```bash
9
11
  Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.
10
12
  /Users/johndoe/.gem/ruby/3.1.2/gems/bundler-2.2.22/lib/bundler/spec_set.rb:91:in `block in materialize': Could not find ruby-prof-0.18.0 in any of the sources (Bundler::GemNotFound)
11
13
  ```
12
14
 
13
- Confirm the version of platformos-check matches the version in the wrapper in `~/bin/platformos-check-language-server`. If it doesn't match the ruby version, run the following from the platformos-check directory:
15
+ **Solution:**
16
+ Ensure the `platformos-check` version in the wrapper in `~/bin/platformos-check-language-server` matches the expected Ruby version. If it doesn't match the Ruby version, run the following command from the platformos-check directory:
14
17
 
15
18
  ```bash
16
- chruby 3.1.2 #your `~/bin/platformos-check-language-server` ruby version
19
+ chruby 3.1.2 #your `~/bin/platformos-check-language-server` ruby version
17
20
  bundle install
18
21
  ```
19
22
 
20
- ### Language server sends an `initialize()` request to the client and stops
23
+ If discrepancies are found, update your environment with the correct version of Ruby and re-install the necessary gems:
24
+
25
+ ### Language Server Initialization Issue
26
+
27
+ **Symptom:**
21
28
 
22
- To debug, confirm these steps are included in your local language server startup script:
29
+ The language server sends an `initialize()` request to the client but then stops responding.
23
30
 
31
+ **Debugging Steps:**
32
+
33
+ 1. Ensure your local language server startup script includes these steps:
24
34
  ```bash
25
35
  export PLATFORMOS_CHECK_DEBUG=true
26
36
  export PLATFORMOS_CHECK_DEBUG_LOG_FILE="/tmp/platformos-check-debug.log"
27
37
  touch "$PLATFORMOS_CHECK_DEBUG_LOG_FILE"
28
38
  ```
29
39
 
30
- An example script can be found [here](/CONTRIBUTING.md#run-language-server).
31
-
32
- Open `/tmp/platformos-check-debug.log` in your IDE. Check if there are any exceptions being raised by language server.
40
+ An example script can be found [in the Contributing Guide](/CONTRIBUTING.md#run-language-server).
33
41
 
34
- If there are no exceptions, check if there are any logs that aren't in jsonrpc. The language server and client use stdin and stdout to communicate using jsonrpc. Debugging statements that aren't in a jsonrpc format might trigger unexpected behavior (this includes any logs from language server or echo statements in your language server script).
42
+ 2. Open the debug log located at `/tmp/platformos-check-debug.log` in your IDE. Check if there are any exceptions being raised by the language server.
35
43
 
44
+ 3. If no exceptions are found, verify that all logs are properly formatted in JSON-RPC. The language server and client communicate using JSON-RPC over `stdin` and `stdout`. Debugging statements that aren't in a JSON-RPC format might trigger unexpected behavior. This includes any logs from the language server or echo statements in your language server script.