Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
Signed-off-by: Jack Cherng <jfcherng@gmail.com>
  • Loading branch information
jfcherng committed Mar 29, 2024
0 parents commit c605a5f
Show file tree
Hide file tree
Showing 31 changed files with 10,882 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# EditorConfig is awesome: https://EditorConfig.org
root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[Makefile]
indent_style = tab

[*.sublime-{settings,commands,keymap,mousemap}]
indent_style = tab
indent_size = 4

[*.sublime-{menu,syntax}]
indent_style = space
indent_size = 2

[*.json]
indent_size = 4

[*.md]
indent_size = 2
trim_trailing_whitespace = false

[*.py]
indent_size = 4

[*.{sh,csh,tcsh,zsh,bash,fish}]
indent_size = 4

[*.{yml,yaml,toml,neon}]
indent_style = space
indent_size = 2

[sublime-package.json]
indent_size = 2
15 changes: 15 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.dependabot export-ignore
.gitattributes export-ignore
.github/ export-ignore
.gitignore export-ignore
.style.yapf export-ignore
.travis.yml export-ignore
codecov.yml export-ignore
docs/ export-ignore
Makefile export-ignore
mkdocs.yml export-ignore
mypy.ini export-ignore
scripts/ export-ignore
tests/ export-ignore
tox.ini export-ignore
unittesting.json export-ignore
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/language-server"
schedule:
interval: "daily"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
53 changes: 53 additions & 0 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python

on:
push:
branches:
- master
- st3
paths:
- '.github/workflows/python.yml'
- '**.py'
- '**.pyi'
- 'Makefile'
pull_request:
branches:
- master
- st3
paths:
- '.github/workflows/python.yml'
- '**.py'
- '**.pyi'
- 'Makefile'

jobs:
job_lint:
name: ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: ['ubuntu-latest']
python-version: ['3.8']

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Do linting
run: |
make ci-check
39 changes: 39 additions & 0 deletions .github/workflows/syntax.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Syntax Tests

on:
push:
branches:
- master
- st3
paths:
- '.github/workflows/syntax.yml'
- '**.sublime-syntax'
- '**/syntax_test*'
pull_request:
branches:
- master
- st3
paths:
- '.github/workflows/syntax.yml'
- '**.sublime-syntax'
- '**/syntax_test*'

jobs:
main:
name: ${{ matrix.build }}
strategy:
matrix:
include:
- build: 4169
packages: master
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Syntax Test
uses: SublimeText/syntax-test-action@v2
with:
build: ${{ matrix.build }}
default_packages: ${{ matrix.packages }}
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.mypy_cache
.tox
.venv-*/
.venv/
__pycache__
node_modules
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 SublimeLSP

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
14 changes: 14 additions & 0 deletions LSP-basedpyright.sublime-commands
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[
{
"caption": "Preferences: LSP-basedpyright Settings",
"command": "edit_settings",
"args": {
"base_file": "${packages}/LSP-basedpyright/LSP-basedpyright.sublime-settings",
"default": "// Settings in here override those in \"LSP-basedpyright/LSP-basedpyright.sublime-settings\"\n\n{\n\t$0\n}\n",
},
},
{
"caption": "LSP-basedpyright: Create Basedpyright Configuration File",
"command": "lsp_basedpyright_create_configuration",
},
]
64 changes: 64 additions & 0 deletions LSP-basedpyright.sublime-settings
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"command": ["${node_bin}", "${server_path}", "--stdio"],
"schemes": [
"file", // regular files
"buffer", // in-memory buffers
"res", // files in .sublime-package archives
],
"disabled_capabilities": {
// set to true if you don't want semantic highlighting
"semanticTokensProvider": false,
// set to true if you don't want inlay hints
"inlayHintProvider": false,
},
// @see https://detachhead.github.io/basedpyright/#/settings?id=pyright-settings
"settings": {
// Use a predefined setup from this plugin, valid values are:
// - "": An empty string does nothing.
// - "sublime_text": Suitable for people who are developing ST Python plugins.
// The Python version which the developed plugin runs on will be used.
// `sys.path` from plugin_host will be added into "basedpyright.analysis.extraPaths"
// so ST package dependecies can be resolved by the LSP server.
// - "sublime_text_33": Similar to "sublime_text" but Python 3.3 forced.
// - "sublime_text_38": Similar to "sublime_text" but Python 3.8 forced.
"basedpyright.dev_environment": "",
// Offer auto-import completions.
"basedpyright.analysis.autoImportCompletions": true,
// Automatically add common search paths like 'src'?
"basedpyright.analysis.autoSearchPaths": true,
// Additional import search resolution paths
"basedpyright.analysis.extraPaths": [],
// Path to directory containing custom type stub files.
"basedpyright.analysis.stubPath": "./typings",
// "openFilesOnly" or "workspace"
"basedpyright.analysis.diagnosticMode": "openFilesOnly",
// Allows a user to override the severity levels for individual diagnostics.
// @see https://detachhead.github.io/basedpyright/#/configuration?id=type-check-diagnostics-settings
"basedpyright.analysis.diagnosticSeverityOverrides": {
"reportDuplicateImport": "warning",
"reportImplicitStringConcatenation": "warning",
"reportUnboundVariable": "warning",
"reportUnusedClass": "information",
"reportUnusedFunction": "information",
"reportUnusedImport": "information",
"reportUnusedVariable": "information",
},
// Specifies the level of logging for the Output panel
"basedpyright.analysis.logLevel": "Information",
// Defines the default rule set for type checking.
"basedpyright.analysis.typeCheckingMode": "standard",
// Paths to look for typeshed modules.
"basedpyright.analysis.typeshedPaths": [],
// Use library implementations to extract type information when type stub is not present.
"basedpyright.analysis.useLibraryCodeForTypes": true,
// Disables type completion, definitions, and references.
"basedpyright.disableLanguageServices": false,
// Disables the "Organize Imports" command.
"basedpyright.disableOrganizeImports": false,
// Path to Python. Leave empty to attempt automatic resolution.
"python.pythonPath": "",
// Path to folder with a list of Virtual Environments.
"python.venvPath": "",
},
"selector": "source.python",
}
34 changes: 34 additions & 0 deletions Main.sublime-menu
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[
{
"id": "preferences",
"children": [
{
"caption": "Package Settings",
"mnemonic": "P",
"id": "package-settings",
"children": [
{
"caption": "LSP",
"id": "lsp-settings",
"children": [
{
"caption": "Servers",
"id": "lsp-servers",
"children": [
{
"caption": "LSP-basedpyright",
"command": "edit_settings",
"args": {
"base_file": "${packages}/LSP-basedpyright/LSP-basedpyright.sublime-settings",
"default": "// Settings in here override those in \"LSP-basedpyright/LSP-basedpyright.sublime-settings\"\n\n{\n\t$0\n}\n",
},
},
],
},
],
},
],
},
],
},
]
23 changes: 23 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
MAKEFLAGS += --silent

.PHONY: all
all:

.PHONY: ci-check
ci-check:
# mypy -p plugin
echo "Check: ruff (lint)"
ruff check --diff .
echo "Check: ruff (format)"
ruff format --diff .

.PHONY: ci-fix
ci-fix:
echo "Fix: ruff (lint)"
ruff check --fix .
echo "Fix: ruff (format)"
ruff format .

.PHONY: update-schema
update-schema:
python3 ./scripts/update_schema.py
Loading

0 comments on commit c605a5f

Please sign in to comment.