generator-sublimelinter 0.3.0 → 0.4.0
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.
- package/README.md +3 -2
- package/generators/app/index.js +87 -76
- package/generators/app/templates/LICENSE.eta +1 -0
- package/generators/app/templates/README.md.eta +35 -0
- package/generators/app/templates/_editorconfig +6 -6
- package/generators/app/templates/{config-circleci.ejs → config-circleci.eta} +2 -2
- package/generators/app/templates/{config-github.ejs → config-github.eta} +2 -2
- package/generators/app/templates/linter.py.eta +27 -0
- package/{generators/lib → lib}/helpers.js +16 -0
- package/package.json +15 -14
- package/generators/app/templates/LICENSE.ejs +0 -1
- package/generators/app/templates/README.md.ejs +0 -34
- package/generators/app/templates/linter.py.ejs +0 -27
package/README.md
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
**Features**
|
|
12
12
|
|
|
13
|
+
- scaffolds Python code for your linter
|
|
13
14
|
- adds any [SPDX](https://spdx.org/licenses/) license
|
|
14
15
|
- adds CI/CD configuration
|
|
15
16
|
- adds [EditorConfig](https://editorconfig.org/) configuration
|
|
@@ -27,7 +28,7 @@ $ npm install -g yo
|
|
|
27
28
|
Use your preferred package manager to install this generator
|
|
28
29
|
|
|
29
30
|
```sh
|
|
30
|
-
$ npm i generator-
|
|
31
|
+
$ npm i generator-sublimelinter -g
|
|
31
32
|
```
|
|
32
33
|
|
|
33
34
|
## Usage
|
|
@@ -35,7 +36,7 @@ $ npm i generator-sublime -g
|
|
|
35
36
|
Run the generator and follow its instructions. Use `--help` for available flags.
|
|
36
37
|
|
|
37
38
|
```sh
|
|
38
|
-
$ yo
|
|
39
|
+
$ yo sublimelinter
|
|
39
40
|
```
|
|
40
41
|
|
|
41
42
|
*“That's all Folks!”*
|
package/generators/app/index.js
CHANGED
|
@@ -1,28 +1,32 @@
|
|
|
1
1
|
import { mkdir } from 'node:fs/promises';
|
|
2
2
|
import { resolve } from 'node:path';
|
|
3
|
+
import { GeneratorCompat as Generator } from '@idleberg/yeoman-generator';
|
|
3
4
|
import slugify from '@sindresorhus/slugify';
|
|
4
|
-
import { pascalCase } from '
|
|
5
|
+
import { pascalCase } from 'change-case';
|
|
6
|
+
import { inverse } from 'kleur/colors';
|
|
5
7
|
import semver from 'semver';
|
|
6
8
|
import spdxLicenseList from 'spdx-license-list/full.js';
|
|
7
9
|
import terminalLink from 'terminal-link';
|
|
8
|
-
import
|
|
9
|
-
import { getDefaultSelector, licenseChoices, validateName } from '../lib/helpers.js';
|
|
10
|
+
import { fileExists, getDefaultSelector, licenseChoices, validateName } from '../../lib/helpers.js';
|
|
10
11
|
|
|
11
12
|
export default class extends Generator {
|
|
12
|
-
constructor(args,
|
|
13
|
-
super(args,
|
|
13
|
+
constructor(args, options) {
|
|
14
|
+
super(args, options);
|
|
14
15
|
|
|
15
16
|
this.option('loose-version', { description: `Doesn't enforce semantic versioning`, default: false });
|
|
16
17
|
this.option('debug', { description: 'Prints debug messages', default: false });
|
|
17
18
|
|
|
18
19
|
this.looseVersion = this.options.looseVersion;
|
|
19
20
|
this.debug = this.options.debug;
|
|
21
|
+
this.outdir = this.options.debug ? '.debug' : '';
|
|
20
22
|
|
|
21
23
|
console.log(/* let it breathe */);
|
|
22
24
|
}
|
|
23
25
|
|
|
24
|
-
async
|
|
25
|
-
|
|
26
|
+
async prompting() {
|
|
27
|
+
this.clack.intro(inverse(` ${slugify(this.appname)} `));
|
|
28
|
+
|
|
29
|
+
const answers = await this.prompt([
|
|
26
30
|
{
|
|
27
31
|
name: 'name',
|
|
28
32
|
message: `What's name of the linter executable?`,
|
|
@@ -34,7 +38,7 @@ export default class extends Generator {
|
|
|
34
38
|
{
|
|
35
39
|
name: 'version',
|
|
36
40
|
message: `What's the plugin's initial version?`,
|
|
37
|
-
default: '0.
|
|
41
|
+
default: '0.1.0',
|
|
38
42
|
store: true,
|
|
39
43
|
validate: (version) =>
|
|
40
44
|
this.looseVersion === true || semver.valid(version) !== null
|
|
@@ -47,7 +51,7 @@ export default class extends Generator {
|
|
|
47
51
|
},
|
|
48
52
|
{
|
|
49
53
|
name: 'interface',
|
|
50
|
-
message: 'Specify
|
|
54
|
+
message: 'Specify a linter interface:',
|
|
51
55
|
type: 'list',
|
|
52
56
|
default: '(default)',
|
|
53
57
|
store: true,
|
|
@@ -84,7 +88,7 @@ export default class extends Generator {
|
|
|
84
88
|
},
|
|
85
89
|
{
|
|
86
90
|
name: 'selector',
|
|
87
|
-
message: `Specify
|
|
91
|
+
message: `Specify a ${terminalLink(
|
|
88
92
|
'selector',
|
|
89
93
|
'http://www.sublimelinter.com/en/stable/linter_settings.html#selector',
|
|
90
94
|
{
|
|
@@ -92,14 +96,14 @@ export default class extends Generator {
|
|
|
92
96
|
return 'selector';
|
|
93
97
|
},
|
|
94
98
|
},
|
|
95
|
-
)}
|
|
99
|
+
)} for files that should be linted:`,
|
|
96
100
|
default: (answers) => getDefaultSelector(answers.interface),
|
|
97
101
|
store: true,
|
|
98
|
-
validate: (
|
|
102
|
+
validate: (answer) => (answer?.length > 0 ? true : 'You have to provide a valid selector'),
|
|
99
103
|
},
|
|
100
104
|
{
|
|
101
105
|
name: 'errorStream',
|
|
102
|
-
message: `Specify the
|
|
106
|
+
message: `Specify the output captured for the ${terminalLink(
|
|
103
107
|
'error stream',
|
|
104
108
|
'http://www.sublimelinter.com/en/stable/linter_attributes.html#error-stream',
|
|
105
109
|
{
|
|
@@ -107,7 +111,7 @@ export default class extends Generator {
|
|
|
107
111
|
return 'error stream';
|
|
108
112
|
},
|
|
109
113
|
},
|
|
110
|
-
)}
|
|
114
|
+
)}:`,
|
|
111
115
|
type: 'list',
|
|
112
116
|
default: 'STREAM_BOTH',
|
|
113
117
|
choices: [
|
|
@@ -128,7 +132,7 @@ export default class extends Generator {
|
|
|
128
132
|
},
|
|
129
133
|
{
|
|
130
134
|
name: 'multiline',
|
|
131
|
-
message: `RegEx pattern
|
|
135
|
+
message: `Does the RegEx pattern capture ${terminalLink(
|
|
132
136
|
'multiline',
|
|
133
137
|
'http://www.sublimelinter.com/en/stable/linter_attributes.html#multiline',
|
|
134
138
|
{
|
|
@@ -136,7 +140,7 @@ export default class extends Generator {
|
|
|
136
140
|
return 'multiline';
|
|
137
141
|
},
|
|
138
142
|
},
|
|
139
|
-
)}
|
|
143
|
+
)}?`,
|
|
140
144
|
type: 'confirm',
|
|
141
145
|
default: false,
|
|
142
146
|
store: true,
|
|
@@ -145,11 +149,11 @@ export default class extends Generator {
|
|
|
145
149
|
name: 'author',
|
|
146
150
|
message: `What's your GitHub username?`,
|
|
147
151
|
store: true,
|
|
148
|
-
validate: (
|
|
152
|
+
validate: (answer) => (answer?.length > 0 ? true : 'You have to provide a username'),
|
|
149
153
|
},
|
|
150
154
|
{
|
|
151
155
|
name: 'spdxLicense',
|
|
152
|
-
message: 'Choose a license',
|
|
156
|
+
message: 'Choose a license for your linter:',
|
|
153
157
|
type: 'list',
|
|
154
158
|
default: 'MIT',
|
|
155
159
|
choices: licenseChoices,
|
|
@@ -158,7 +162,7 @@ export default class extends Generator {
|
|
|
158
162
|
{
|
|
159
163
|
type: 'checkbox',
|
|
160
164
|
name: 'tests',
|
|
161
|
-
message: 'Add
|
|
165
|
+
message: 'Add CI/CD pipeline configurations?',
|
|
162
166
|
store: true,
|
|
163
167
|
choices: [
|
|
164
168
|
{
|
|
@@ -183,94 +187,101 @@ export default class extends Generator {
|
|
|
183
187
|
},
|
|
184
188
|
{
|
|
185
189
|
name: 'flakeArgs',
|
|
186
|
-
message: `Specify ${terminalLink('flake8', 'http://flake8.pycqa.org/', {
|
|
190
|
+
message: `Specify arguments for ${terminalLink('flake8', 'http://flake8.pycqa.org/', {
|
|
187
191
|
fallback() {
|
|
188
192
|
return 'flake8';
|
|
189
193
|
},
|
|
190
|
-
})}
|
|
191
|
-
default: '-ignore=D211',
|
|
194
|
+
})}:`,
|
|
195
|
+
default: '--extend-ignore=D211',
|
|
192
196
|
store: true,
|
|
193
197
|
when: (answers) => answers.tests.length > 0,
|
|
194
198
|
},
|
|
195
199
|
{
|
|
196
200
|
name: 'pepArgs',
|
|
197
|
-
message: `Specify ${terminalLink('pep257', 'https://pep257.readthedocs.io/', {
|
|
201
|
+
message: `Specify arguments for ${terminalLink('pep257', 'https://pep257.readthedocs.io/', {
|
|
198
202
|
fallback() {
|
|
199
203
|
return 'pep257';
|
|
200
204
|
},
|
|
201
|
-
})}
|
|
205
|
+
})}:`,
|
|
202
206
|
default: '--ignore=D211',
|
|
203
207
|
store: true,
|
|
204
208
|
when: (answers) => answers.tests.length > 0,
|
|
205
209
|
},
|
|
206
210
|
{
|
|
207
211
|
name: 'initGit',
|
|
208
|
-
message: 'Initialize Git repository?',
|
|
212
|
+
message: 'Initialize a Git repository?',
|
|
209
213
|
type: 'confirm',
|
|
210
|
-
default: !
|
|
214
|
+
default: !(await fileExists(resolve(process.cwd(), '.git', 'config'))),
|
|
211
215
|
},
|
|
212
|
-
])
|
|
213
|
-
if (this.options.debug) {
|
|
214
|
-
console.log(props);
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
props.slug = slugify(props.name);
|
|
218
|
-
props.repositoryName = `SublimeLinter-contrib-${props.slug}`;
|
|
219
|
-
props.className = pascalCase(props.name);
|
|
220
|
-
props.multiline = props.multiline === true ? 'True' : 'False';
|
|
216
|
+
]);
|
|
221
217
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
props.licenseText = spdxLicenseList[props.spdxLicense].licenseText.replace(/\n{3,}/g, '\n\n');
|
|
225
|
-
}
|
|
218
|
+
this.answers = answers;
|
|
219
|
+
}
|
|
226
220
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
}
|
|
221
|
+
async writing() {
|
|
222
|
+
if (this.options.debug) {
|
|
223
|
+
console.log(this.answers);
|
|
224
|
+
}
|
|
232
225
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
226
|
+
this.answers.slug = slugify(this.answers.name);
|
|
227
|
+
this.answers.repositoryName = `SublimeLinter-contrib-${this.answers.slug}`;
|
|
228
|
+
this.answers.className = pascalCase(this.answers.name);
|
|
229
|
+
this.answers.multiline = this.answers.multiline === true ? 'True' : 'False';
|
|
237
230
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
}
|
|
231
|
+
if (typeof this.answers.spdxLicense !== 'undefined') {
|
|
232
|
+
this.answers.licenseName = spdxLicenseList[this.answers.spdxLicense].name;
|
|
233
|
+
this.answers.licenseText = spdxLicenseList[this.answers.spdxLicense].licenseText.replace(/\n{3,}/g, '\n\n');
|
|
234
|
+
}
|
|
243
235
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
236
|
+
if (typeof this.answers.spdxLicense !== 'undefined') {
|
|
237
|
+
this.fs.copyTpl(this.templatePath('LICENSE.eta'), this.destinationPath(this.outdir, 'LICENSE'), {
|
|
238
|
+
licenseText: this.answers.licenseText,
|
|
239
|
+
});
|
|
240
|
+
}
|
|
248
241
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
}
|
|
242
|
+
if (this.answers.tests.includes('circleCI')) {
|
|
243
|
+
await mkdir('.circleci', {
|
|
244
|
+
recursive: true,
|
|
245
|
+
});
|
|
254
246
|
|
|
255
|
-
this.fs.
|
|
247
|
+
this.fs.copyTpl(
|
|
248
|
+
this.templatePath('config-circleci.eta'),
|
|
249
|
+
this.destinationPath(this.outdir, '.circleci/config.yml'),
|
|
250
|
+
{
|
|
251
|
+
flakeArgs: this.answers.flakeArgs.trim(),
|
|
252
|
+
pepArgs: this.answers.pepArgs.trim(),
|
|
253
|
+
},
|
|
254
|
+
);
|
|
255
|
+
}
|
|
256
256
|
|
|
257
|
-
|
|
258
|
-
|
|
257
|
+
if (this.answers.tests.includes('githubWorkflow')) {
|
|
258
|
+
await mkdir('.github/workflows', {
|
|
259
|
+
recursive: true,
|
|
259
260
|
});
|
|
260
261
|
|
|
261
|
-
this.fs.copyTpl(
|
|
262
|
-
|
|
263
|
-
|
|
262
|
+
this.fs.copyTpl(
|
|
263
|
+
this.templatePath('config-github.eta'),
|
|
264
|
+
this.destinationPath(this.outdir, '.github/workflows/config.yml'),
|
|
265
|
+
{
|
|
266
|
+
flakeArgs: this.answers.flakeArgs.trim(),
|
|
267
|
+
pepArgs: this.answers.pepArgs.trim(),
|
|
268
|
+
},
|
|
269
|
+
);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
this.fs.copy(this.templatePath('_editorconfig'), this.destinationPath(this.outdir, '.editorconfig'));
|
|
264
273
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
}
|
|
274
|
+
this.fs.copyTpl(this.templatePath('linter.py.eta'), this.destinationPath(this.outdir, 'linter.py'), {
|
|
275
|
+
...this.answers,
|
|
276
|
+
});
|
|
269
277
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
this.spawn(String(process.env.EDITOR), ['.']);
|
|
273
|
-
}
|
|
278
|
+
this.fs.copyTpl(this.templatePath('README.md.eta'), this.destinationPath(this.outdir, 'README.md'), {
|
|
279
|
+
...this.answers,
|
|
274
280
|
});
|
|
281
|
+
|
|
282
|
+
// Initialize git repository
|
|
283
|
+
if (this.answers.initGit) {
|
|
284
|
+
this.spawnSync('git', ['init']);
|
|
285
|
+
}
|
|
275
286
|
}
|
|
276
287
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<%= it.licenseText %>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# <%= it.repositoryName %>
|
|
2
|
+
|
|
3
|
+
[](https://opensource.org/licenses/<%= it.spdxLicense %>)
|
|
4
|
+
[](https://github.com//<%= it.author %>/<%= it.repositoryName %>/releases/latest)<% if (it.tests.includes('circleCI')) { %>
|
|
5
|
+
[](https://circleci.com/gh/<%= it.author %>/<%= it.repositoryName %>)<% } %>
|
|
6
|
+
|
|
7
|
+
This linter plugin for [SublimeLinter](https://github.com/SublimeLinter/SublimeLinter) provides an interface to `<%= it.slug %>`
|
|
8
|
+
|
|
9
|
+
## Prerequisites
|
|
10
|
+
|
|
11
|
+
1. Make sure you have [SublimeLinter](https://github.com/SublimeLinter/SublimeLinter) installed
|
|
12
|
+
2. Ensure that `<%= it.slug %>` is installed on your system and available in your [PATH environmental variable](http://sublimelinter.readthedocs.io/en/latest/troubleshooting.html#finding-a-linter-executable)
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
### Package Control
|
|
17
|
+
|
|
18
|
+
1. Make sure you have [Package Control](https://packagecontrol.io/) installed
|
|
19
|
+
2. Choose *“Install Package”* from the Command Palette (<kbd>Super</kbd>+<kbd>Shift</kbd>+<kbd>p</kbd>)
|
|
20
|
+
3. Type *“<%= it.repositoryName %>”* and press <kbd>Enter</kbd>
|
|
21
|
+
|
|
22
|
+
With the [`auto_upgrade`](https://packagecontrol.io/docs/settings#setting-auto_upgrade) setting enabled, Package Control will keep all installed packages up-to-date!
|
|
23
|
+
|
|
24
|
+
### Using Git
|
|
25
|
+
|
|
26
|
+
1. Change to your Sublime Text `Packages` directory
|
|
27
|
+
2. Clone repository `git clone https://github.com/<%= it.author %>/<%= it.repositoryName %>.git <%= it.repositoryName %>`
|
|
28
|
+
|
|
29
|
+
## Settings
|
|
30
|
+
|
|
31
|
+
Please refer to the official documentation in order to tweak the [SublimeLinter settings](http://sublimelinter.readthedocs.org/en/latest/settings.html) or [linter settings](http://sublimelinter.readthedocs.org/en/latest/linter_settings.html).
|
|
32
|
+
|
|
33
|
+
## License
|
|
34
|
+
|
|
35
|
+
This work is licensed under the [<%= it.licenseName %>](LICENSE)
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
root = true
|
|
3
3
|
|
|
4
4
|
[*]
|
|
5
|
-
indent_style = space
|
|
6
|
-
indent_size = 2
|
|
7
5
|
charset = utf-8
|
|
8
|
-
|
|
6
|
+
end_of_line = lf
|
|
7
|
+
indent_size = 2
|
|
8
|
+
indent_style = tab
|
|
9
9
|
insert_final_newline = true
|
|
10
|
-
|
|
10
|
+
trim_trailing_whitespace = true
|
|
11
11
|
|
|
12
12
|
[*.{py,rst,txt}]
|
|
13
|
+
end_of_line = lf
|
|
14
|
+
indent_size = 4
|
|
13
15
|
indent_style = space
|
|
14
16
|
trim_trailing_whitespace = true
|
|
15
|
-
indent_size = 4
|
|
16
|
-
end_of_line = LF
|
|
17
17
|
|
|
18
18
|
[*.md]
|
|
19
19
|
trim_trailing_whitespace = false
|
|
@@ -28,8 +28,8 @@ jobs:
|
|
|
28
28
|
name: Run tests
|
|
29
29
|
command: |
|
|
30
30
|
. venv/bin/activate
|
|
31
|
-
flake8 ./linter.py
|
|
32
|
-
pep257 ./linter.py
|
|
31
|
+
flake8 ./linter.py <%= it.flakeArgs %>
|
|
32
|
+
pep257 ./linter.py <%= it.pepArgs %>
|
|
33
33
|
|
|
34
34
|
- store_artifacts:
|
|
35
35
|
path: test-reports
|
|
@@ -49,8 +49,8 @@ jobs:
|
|
|
49
49
|
- name: Run tests
|
|
50
50
|
run: |
|
|
51
51
|
. venv/bin/activate
|
|
52
|
-
flake8 ./linter.py
|
|
53
|
-
pep257 ./linter.py
|
|
52
|
+
flake8 ./linter.py <%= it.flakeArgs %>
|
|
53
|
+
pep257 ./linter.py <%= it.pepArgs %>
|
|
54
54
|
|
|
55
55
|
- name: Archive test reports
|
|
56
56
|
uses: actions/upload-artifact@1746f4ab65b179e0ea60a494b83293b640dd5bba #v4.3.2
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#
|
|
2
|
+
# linter.py
|
|
3
|
+
# Copyright (c) <%= new Date().getFullYear() %> <%= it.author %>
|
|
4
|
+
# <%= it.licenseName %>
|
|
5
|
+
#
|
|
6
|
+
# https://github.com/<%= it.author %>/<%= it.repositoryName %>
|
|
7
|
+
#
|
|
8
|
+
|
|
9
|
+
"""This module exports the <%= it.className %> plugin class."""
|
|
10
|
+
|
|
11
|
+
from SublimeLinter.lint import <%= it.interface %>, util
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class <%= it.className %>(<%= it.interface %>):
|
|
15
|
+
|
|
16
|
+
"""Provides an interface to the <%= it.className %> executable."""
|
|
17
|
+
|
|
18
|
+
cmd = ('<%= it.slug %>', '${file}')
|
|
19
|
+
defaults = {
|
|
20
|
+
'selector': '<%= it.selector %>'
|
|
21
|
+
}
|
|
22
|
+
regex = (
|
|
23
|
+
r'^(?P<file>.+):(?P<line>\d+):col (?P<col>\d+): (?P<message>.+)$'
|
|
24
|
+
)
|
|
25
|
+
multiline = <%= it.multiline %>
|
|
26
|
+
error_stream = util.<%= it.errorStream %>
|
|
27
|
+
line_col_base = (1, 1)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// @ts-check
|
|
2
|
+
import { access, constants } from 'node:fs/promises';
|
|
2
3
|
import spdxLicenseList from 'spdx-license-list/full.js';
|
|
3
4
|
import terminalLink from 'terminal-link';
|
|
4
5
|
|
|
@@ -49,3 +50,18 @@ export function validateName(name) {
|
|
|
49
50
|
|
|
50
51
|
return true;
|
|
51
52
|
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
*
|
|
56
|
+
* @param {string} filePath
|
|
57
|
+
* @returns {Promise<boolean>}
|
|
58
|
+
*/
|
|
59
|
+
export async function fileExists(filePath) {
|
|
60
|
+
try {
|
|
61
|
+
await access(filePath, constants.F_OK);
|
|
62
|
+
} catch {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return true;
|
|
67
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "generator-sublimelinter",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Yeoman generator for SublimeLinter plugins",
|
|
5
5
|
"author": "Jan T. Sott",
|
|
6
6
|
"license": "MIT",
|
|
@@ -11,47 +11,48 @@
|
|
|
11
11
|
"sublime text"
|
|
12
12
|
],
|
|
13
13
|
"type": "module",
|
|
14
|
-
"exports": "./generators/app",
|
|
14
|
+
"exports": "./generators/app/index.js",
|
|
15
15
|
"files": [
|
|
16
16
|
"generators",
|
|
17
|
+
"lib",
|
|
17
18
|
"LICENSE",
|
|
18
19
|
"README.md"
|
|
19
20
|
],
|
|
20
21
|
"repository": {
|
|
21
22
|
"type": "git",
|
|
22
|
-
"url": "https://github.com/idleberg/generator-sublimelinter"
|
|
23
|
+
"url": "git+https://github.com/idleberg/generator-sublimelinter.git"
|
|
23
24
|
},
|
|
24
25
|
"engines": {
|
|
25
26
|
"node": ">=20"
|
|
26
27
|
},
|
|
27
28
|
"dependencies": {
|
|
29
|
+
"@idleberg/yeoman-generator": "^0.1.1",
|
|
28
30
|
"@sindresorhus/slugify": "^3.0.0",
|
|
29
|
-
"
|
|
31
|
+
"change-case": "^5.4.4",
|
|
30
32
|
"semver": "^7.7.3",
|
|
31
|
-
"spdx-license-list": "^6.
|
|
33
|
+
"spdx-license-list": "^6.11.0",
|
|
32
34
|
"terminal-link": "^5.0.0",
|
|
33
35
|
"yeoman-generator": "^7.5.1"
|
|
34
36
|
},
|
|
35
37
|
"devDependencies": {
|
|
36
|
-
"@commitlint/cli": "^20.3.
|
|
37
|
-
"@commitlint/config-conventional": "^20.3.
|
|
38
|
+
"@commitlint/cli": "^20.3.1",
|
|
39
|
+
"@commitlint/config-conventional": "^20.3.1",
|
|
38
40
|
"@idleberg/configs": "^0.4.1",
|
|
39
|
-
"@
|
|
41
|
+
"@types/node": "^24.10.4",
|
|
40
42
|
"@types/yeoman-assert": "^3.1.4",
|
|
41
|
-
"@yeoman/adapter": "^
|
|
43
|
+
"@yeoman/adapter": "^4.0.1",
|
|
42
44
|
"@yeoman/types": "^1.8.0",
|
|
43
45
|
"concurrently": "^9.2.1",
|
|
44
|
-
"
|
|
45
|
-
"mem-fs": "^4.1.
|
|
46
|
+
"kleur": "^4.1.5",
|
|
47
|
+
"mem-fs": "^4.1.3",
|
|
46
48
|
"np": "^10.2.0",
|
|
47
|
-
"vitest": "^4.0.
|
|
49
|
+
"vitest": "^4.0.17",
|
|
48
50
|
"yeoman-assert": "^3.1.1",
|
|
49
51
|
"yeoman-environment": "^5.1.1",
|
|
50
52
|
"yeoman-test": "^11.2.0"
|
|
51
53
|
},
|
|
52
54
|
"scripts": {
|
|
53
|
-
"lint:e18e": "
|
|
54
|
-
"lint:ejs": "ejslint generators/**/*.ejs",
|
|
55
|
+
"lint:e18e": "e18e-cli analyze",
|
|
55
56
|
"lint:code": "biome check",
|
|
56
57
|
"lint": "concurrently --prefix '{name}' -c 'green,blue' 'npm:lint:*'",
|
|
57
58
|
"publish:npm": "np --no-yarn",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<%- licenseText %>
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# <%= props.repositoryName %>
|
|
2
|
-
|
|
3
|
-
[](https://opensource.org/licenses/<%= props.spdxLicense %>)<% if (props.tests.includes('circleCI')) { %>
|
|
4
|
-
[](https://circleci.com/gh/<%= props.author %>/<%= props.repositoryName %>)<% } %>
|
|
5
|
-
|
|
6
|
-
This linter plugin for [SublimeLinter](https://github.com/SublimeLinter/SublimeLinter) provides an interface to `<%= props.slug %>`
|
|
7
|
-
|
|
8
|
-
## Prerequisites
|
|
9
|
-
|
|
10
|
-
1. Make sure you have [SublimeLinter](https://github.com/SublimeLinter/SublimeLinter) installed
|
|
11
|
-
2. Ensure that `<%= props.slug %>` is installed on your system and available in your [PATH environmental variable](http://sublimelinter.readthedocs.io/en/latest/troubleshooting.html#finding-a-linter-executable)
|
|
12
|
-
|
|
13
|
-
## Installation
|
|
14
|
-
|
|
15
|
-
### Package Control
|
|
16
|
-
|
|
17
|
-
1. Make sure you have [Package Control](https://packagecontrol.io/) installed
|
|
18
|
-
2. Choose *“Install Package”* from the Command Palette (<kbd>Super</kbd>+<kbd>Shift</kbd>+<kbd>p</kbd>)
|
|
19
|
-
3. Type *“<%= props.repositoryName %>”* and press <kbd>Enter</kbd>
|
|
20
|
-
|
|
21
|
-
With the [`auto_upgrade`](https://packagecontrol.io/docs/settings#setting-auto_upgrade) setting enabled, Package Control will keep all installed packages up-to-date!
|
|
22
|
-
|
|
23
|
-
### Using Git
|
|
24
|
-
|
|
25
|
-
1. Change to your Sublime Text `Packages` directory
|
|
26
|
-
2. Clone repository `git clone https://github.com/<%= props.author %>/<%= props.repositoryName %>.git <%= props.repositoryName %>`
|
|
27
|
-
|
|
28
|
-
## Settings
|
|
29
|
-
|
|
30
|
-
Please refer to the official documentation in order to tweak the [SublimeLinter settings](http://sublimelinter.readthedocs.org/en/latest/settings.html) or [linter settings](http://sublimelinter.readthedocs.org/en/latest/linter_settings.html).
|
|
31
|
-
|
|
32
|
-
## License
|
|
33
|
-
|
|
34
|
-
This work is licensed under the [<%= props.licenseName %>](LICENSE)
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
#
|
|
2
|
-
# linter.py
|
|
3
|
-
# Copyright (c) <%- new Date().getYear() %>> <%= props.author %>
|
|
4
|
-
# <%= props.licenseName %>
|
|
5
|
-
#
|
|
6
|
-
# https://github.com/<%= props.author %>/<%= props.repositoryName %>
|
|
7
|
-
#
|
|
8
|
-
|
|
9
|
-
"""This module exports the <%= props.className %> plugin class."""
|
|
10
|
-
|
|
11
|
-
from SublimeLinter.lint import <%= props.interface %>, util
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class <%= props.className %>(<%= props.interface %>):
|
|
15
|
-
|
|
16
|
-
"""Provides an interface to the <%= props.className %> executable."""
|
|
17
|
-
|
|
18
|
-
cmd = ('<%= props.slug %>', '${file}')
|
|
19
|
-
defaults = {
|
|
20
|
-
'selector': '<%= props.selector %>'
|
|
21
|
-
}
|
|
22
|
-
regex = (
|
|
23
|
-
r'^(?P<file>.+):(?P<line>\d+):col (?P<col>\d+): (?P<message>.+)$'
|
|
24
|
-
)
|
|
25
|
-
multiline = <%= props.multiline %>
|
|
26
|
-
error_stream = util.<%= props.errorStream %>
|
|
27
|
-
line_col_base = (1, 1)
|