-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #1 + removed ruff as main dependency + raises exception on zer…
…o targets
- Loading branch information
Showing
15 changed files
with
185 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ pkgs ? import <nixpkgs> {} }: | ||
|
||
with pkgs; | ||
|
||
python312Packages.buildPythonPackage { | ||
pname = "ruff-quickfix"; | ||
version = "0.1.1"; | ||
pyproject = true; | ||
|
||
src = ./.; | ||
|
||
nativeBuildInputs = [ | ||
python312Packages.poetry-core | ||
ruff | ||
]; | ||
|
||
propagatedBuildInputs = with python312Packages; [ | ||
click | ||
]; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,26 @@ | ||
[tool.poetry] | ||
name = "ruff-quickfix" | ||
version = "0.1.0" | ||
version = "0.1.1" | ||
description = "Wrapper for the `ruff` command for (neo)vim's quickfix" | ||
authors = ["Neal Joslin <[email protected]>"] | ||
readme = "README.md" | ||
license = "LICENSE" | ||
keywords = ["ruff", "cli", "vim", "neovim", "nvim", "quickfix"] | ||
repository = "https://github.com/Nealium/ruff-quickfix" | ||
keywords = ["ruff", "cli", "vim", "neovim", "nvim", "quickfix"] | ||
packages = [ | ||
{ include = "ruff_quickfix", from = "src" }, | ||
] | ||
|
||
[tool.poetry.scripts] | ||
ruff-quickfix = "ruff_quickfix.cli:cli" | ||
ruff-quickfix = "ruff_quickfix:cli" | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.8" | ||
click = "^8.1.7" | ||
ruff = "^0.6.1" | ||
ruff = { version = "^0.6.1", optional = true } | ||
|
||
[tool.poetry.extras] | ||
ruff = ["ruff"] | ||
|
||
[tool.poetry.group.dev.dependencies] | ||
pre-commit = { version = "^3.8.0", python = "^3.9" } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
with import <nixpkgs> { }; | ||
|
||
mkShell { | ||
name = "ruff-qf-dev"; | ||
|
||
buildInputs = [ | ||
ruff | ||
python312Packages.poetry-core | ||
python312Packages.click | ||
python312Packages.mypy | ||
python312Packages.pytest | ||
python312Packages.pytest-click | ||
python312Packages.pytest-cov | ||
python312Packages.tox | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
Author: Neal Joslin | ||
Date: 2024-08-17 | ||
Email: [email protected] | ||
Description: Wrapper for the `ruff` linter for (neo)vim's quickfix | ||
Description: import entry | ||
""" | ||
|
||
from .cli import cli | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
""" | ||
File: ruff_quickfix/__main__.py | ||
Author: Neal Joslin | ||
Date: 2024-08-21 | ||
Email: [email protected] | ||
Description: module entry | ||
""" | ||
|
||
# TODO (Neal): figure out how to test this line | ||
from . import cli # pragma: no cover | ||
|
||
if __name__ == "__main__": # pragma: no cover | ||
cli(obj={}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
""" | ||
File: cli | ||
File: ruff_quickfix/cli | ||
Author: Neal Joslin | ||
Date: 2024-08-17 | ||
Email: [email protected] | ||
|
@@ -10,16 +10,15 @@ | |
|
||
import click | ||
|
||
from .main import lint | ||
from .lint import lint | ||
|
||
|
||
@click.command() | ||
@click.argument("targets", nargs=-1) | ||
def cli(targets: list[str]) -> None: | ||
"""Ruff wrapper for (neo)vim's quickfix""" | ||
if not len(targets): | ||
msg = "No targets" | ||
raise click.UsageError(msg) | ||
for path in targets: | ||
lint(path) | ||
|
||
|
||
if __name__ == "__main__": # pragma: no cover | ||
cli(obj={}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
""" | ||
File: ruff_quickfix/main.py | ||
File: ruff_quickfix/lint.py | ||
Author: Neal Joslin | ||
Date: 2024-08-17 | ||
Date: 2024-08-21 | ||
Email: [email protected] | ||
Description: Main functionality | ||
Description: Linting and formatting | ||
""" | ||
|
||
import re | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters