Skip to content

Commit

Permalink
Add rye project management configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
kaste committed Mar 5, 2024
1 parent 61849c6 commit a78e38a
Show file tree
Hide file tree
Showing 5 changed files with 129 additions and 8 deletions.
37 changes: 33 additions & 4 deletions README.md
Expand Up @@ -67,9 +67,19 @@ As we do *just* linting SublimeLinter naturally does not come with fixers
and/or code formatters. However, we have a fixer API, see the Command Palette: `SublimeLinter: Quick Action`, and ship (mostly)
"fix by ignoring" actions. These allow you to quickly ignore specific error messages *inline* and ad hoc.[1]

SublimeLinter currently ships actions for [eslint](https://github.com/SublimeLinter/SublimeLinter-eslint), [stylelint](https://github.com/SublimeLinter/SublimeLinter-stylelint), [flake8](https://github.com/SublimeLinter/SublimeLinter-flake8), [mypy](https://github.com/fredcallaway/SublimeLinter-contrib-mypy), shellcheck, [codespell](https://github.com/kaste/SublimeLinter-contrib-codespell) and [phpcs](https://github.com/SublimeLinter/SublimeLinter-phpcs).

Want to see actions for your favourite linter? Please open a PR with your addition to [quick_fix.py](https://github.com/SublimeLinter/SublimeLinter/blob/master/lint/quick_fix.py). We have [tests](https://github.com/SublimeLinter/SublimeLinter/tree/master/tests/test_ignore_fixers.py) for them!
SublimeLinter currently ships actions for
[eslint](https://github.com/SublimeLinter/SublimeLinter-eslint),
[stylelint](https://github.com/SublimeLinter/SublimeLinter-stylelint),
[flake8](https://github.com/SublimeLinter/SublimeLinter-flake8),
[mypy](https://github.com/fredcallaway/SublimeLinter-contrib-mypy),
shellcheck,
[codespell](https://github.com/kaste/SublimeLinter-contrib-codespell)
and
[phpcs](https://github.com/SublimeLinter/SublimeLinter-phpcs).

Want to see actions for your favourite linter? Please open a PR with your addition to
[quick_fix.py](https://github.com/SublimeLinter/SublimeLinter/blob/master/lint/quick_fix.py).
We have [tests](https://github.com/SublimeLinter/SublimeLinter/tree/master/tests/test_ignore_fixers.py) for them!

[1] Why this limitation though? Well it is usually easy to add a semicolon here and a space there, but the inline ignore rules and syntaxes are very cumbersome to type and to remember. And there is basically no project of any size where you don't have to ignore ad-hoc something somewhere once.

Expand All @@ -86,7 +96,26 @@ should be noted and helpful.
As some code only runs on startup, it is good practice to restart Sublime Text
and to examine the console output for anything odd.

If your issue is specific to a particular linter, please report it on that linter's repository, otherwise open it right [here](https://github.com/SublimeLinter/SublimeLinter/issues).
If your issue is specific to a particular linter, please report it on that linter's repository,
otherwise open it right [here](https://github.com/SublimeLinter/SublimeLinter/issues).


## Hack on it

Sure, you're welcome! Just clone the repository into your Packages folder (*Preferences -> Browse Packages*).

```shell
> git clone https://github.com/SublimeLinter/SublimeLinter.git
> subl SublimeLinter
```

This will overrule the installed package straight away. Just delete the folder
to reverse the process. The dev requirements can be read in the `pyproject.toml` file.
Just use `rye` and install them:

```shell
> rye sync
```


## Creating a linter plugin
Expand Down
14 changes: 14 additions & 0 deletions pyproject.toml
@@ -0,0 +1,14 @@
[project]
name = "SublimeLinter"
readme = "README.md"
requires-python = ">= 3.12"

[tool.rye]
managed = true
virtual = true
dev-dependencies = [
"Sphinx",
"flake8==5.*",
"mypy",
"sphinx-autobuild",
]
73 changes: 73 additions & 0 deletions requirements-dev.lock
@@ -0,0 +1,73 @@
# generated by rye
# use `rye lock` or `rye sync` to update this lockfile
#
# last locked with the following flags:
# pre: false
# features: []
# all-features: false
# with-sources: false

alabaster==0.7.16
# via sphinx
babel==2.14.0
# via sphinx
certifi==2024.2.2
# via requests
charset-normalizer==3.3.2
# via requests
colorama==0.4.6
# via sphinx
# via sphinx-autobuild
docutils==0.20.1
# via sphinx
flake8==5.0.4
idna==3.6
# via requests
imagesize==1.4.1
# via sphinx
jinja2==3.1.3
# via sphinx
livereload==2.6.3
# via sphinx-autobuild
markupsafe==2.1.5
# via jinja2
mccabe==0.7.0
# via flake8
mypy==1.8.0
mypy-extensions==1.0.0
# via mypy
packaging==23.2
# via sphinx
pycodestyle==2.9.1
# via flake8
pyflakes==2.5.0
# via flake8
pygments==2.17.2
# via sphinx
requests==2.31.0
# via sphinx
six==1.16.0
# via livereload
snowballstemmer==2.2.0
# via sphinx
sphinx==7.2.6
# via sphinx-autobuild
sphinx-autobuild==2024.2.4
sphinxcontrib-applehelp==1.0.8
# via sphinx
sphinxcontrib-devhelp==1.0.6
# via sphinx
sphinxcontrib-htmlhelp==2.0.5
# via sphinx
sphinxcontrib-jsmath==1.0.1
# via sphinx
sphinxcontrib-qthelp==1.0.7
# via sphinx
sphinxcontrib-serializinghtml==1.1.10
# via sphinx
tornado==6.4
# via livereload
typing-extensions==4.10.0
# via mypy
urllib3==2.2.1
# via requests
4 changes: 0 additions & 4 deletions requirements-dev.txt

This file was deleted.

9 changes: 9 additions & 0 deletions requirements.lock
@@ -0,0 +1,9 @@
# generated by rye
# use `rye lock` or `rye sync` to update this lockfile
#
# last locked with the following flags:
# pre: false
# features: []
# all-features: false
# with-sources: false

0 comments on commit a78e38a

Please sign in to comment.