Compare commits

...

9 commits

Author SHA1 Message Date
9e24f7cb85 Update version to v2025.07.11 2025-07-11 23:05:37 +10:00
699f808951 packaging: Just depend on ruby instead of ruby3.1
- Let debian bookworm and trixie both work.
- Other distros are using ruby.
2025-07-11 23:03:17 +10:00
327852af40 tools: Let rubocop do autocorrect patches 2025-06-27 23:18:17 +10:00
267a100b09 tools: Add patch command to "git diff"
- May as well let the changes be easily removed.
2025-06-27 23:02:57 +10:00
906b0510bb Add patch_command to the tool summary 2025-06-24 22:10:46 +10:00
a8f3261ab8 tools: Fix isort
- Isort's has patches containing absolute paths that don't apply.
- Let isort apply the patch itself.
- The patch_command can either do the patch or return a patch.
2025-06-24 18:33:01 +10:00
ac7c7010df Update version to v2025.06.21 2025-06-21 14:43:57 +10:00
754143b395 Add a patch command
- Make it easy to apply the patches some tools produce.
2025-06-21 14:41:06 +10:00
99ed8efc43 Fix incorrect extension when listing tools 2025-06-14 11:29:15 +10:00
14 changed files with 48 additions and 34 deletions

View file

@ -12,11 +12,11 @@ Eris can be installed by pipx or [uv](https://docs.astral.sh/uv/getting-started/
To install with pipx:
pipx install git+https://gitlab.com/ahamilton/eris@v2025.06.14
pipx install git+https://gitlab.com/ahamilton/eris@v2025.07.11
or to install with uv:
uv tool install git+https://gitlab.com/ahamilton/eris@v2025.06.14
uv tool install git+https://gitlab.com/ahamilton/eris@v2025.07.11
Then use eris to install all the tools it uses:

View file

@ -1,3 +1 @@
__version__ = "v2025.06.14"
__version__ = "v2025.07.11"

View file

@ -88,6 +88,7 @@ KEYS_DOC = """Keys:
R - Refresh all reports of the current tool.
f - Resize the focused pane to the full screen. (toggle)
o - Open the current file with xdg-open.
p - Patch the current file. (When viewing a patch from a tool)
"""
@ -786,6 +787,15 @@ class Screen:
in_green(f" at line {line_num}")])
subprocess.Popen(f"{self.editor_command} +{line_num} {path}", shell=True,
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
def patch_file(self):
result = self._summary.get_selection()
if hasattr(result.tool, "patch_command") and result.tool.patch_command is not None:
path = result.path
path_colored = lscolors.path_colored(path)
self._log.log_message([in_green("Patching file: "), path_colored])
subprocess.run(f"{result.tool.patch_command} {path} | patch -p0", shell=True,
capture_output=True)
subprocess.run(["touch", path])
def toggle_status_style(self):
self._summary.toggle_status_style(self._log)
@ -915,7 +925,7 @@ class Screen:
tools.STATUS_TO_TERMSTR[widget.status] + divider + "line " + str(y+1))
_STATUS_BAR = highlight_chars(" *help *quit *t*a*b:focus *turn *log *edit *next *sort"
" *refresh *fullscreen *open", Log._GREEN_STYLE)
" *refresh *fullscreen *open *patch", Log._GREEN_STYLE)
@functools.cache
def _get_partial_bar_chars(self, bar_transparency):
@ -963,9 +973,9 @@ class Screen:
terminal.RIGHT: cursor_right, terminal.PAGE_DOWN: cursor_page_down,
terminal.PAGE_UP: cursor_page_up, "s": toggle_order, terminal.HOME: cursor_home,
terminal.END: cursor_end, "n": move_to_next_issue, "N": move_to_next_issue_of_tool,
"e": edit_file, "q": quit_, terminal.ESC: quit_, terminal.CTRL_C: quit_,
"r": refresh, "R": refresh_tool, "\t": toggle_focus, "f": toggle_fullscreen,
"o": xdg_open}
"e": edit_file, "p": patch_file, "q": quit_, terminal.ESC: quit_,
terminal.CTRL_C: quit_, "r": refresh, "R": refresh_tool, "\t": toggle_focus,
"f": toggle_fullscreen, "o": xdg_open}
def setup_inotify(root_path, loop, on_filesystem_event, exclude_filter):
@ -1129,12 +1139,14 @@ def print_tool_info():
for tool in sorted(tools.tools_all(), key=lambda t: t.__name__):
print(termstr.TermStr(tool.__name__, is_bold=True) if tools.is_tool_available(tool)
else termstr.TermStr(tool.__name__, fg_color=termstr.Color.red) + " (not available)")
extensions = list(extensions_for_tool.get(tool, {"*"}))
if hasattr(tool, "command"):
print(f"command: {tool.command} foo.{extensions[0]}")
else:
print("function:", "eris.tools." + tool.__name__)
if hasattr(tool, "patch_command") and tool.patch_command is not None:
print(f"patch command: {tool.patch_command} foo.{extensions[0]}")
print("url:", tool.url)
extensions = list(extensions_for_tool.get(tool, {"*"}))
print("extensions:", ", ".join(extensions))
print("")
@ -1145,8 +1157,7 @@ def install_all_tools():
install_command = ["apt", "-y", "install"] # debian / ubuntu
if "ID=fedora\n" in os_release_lines:
tools_.remove("lua-check")
renames = {"lua5.3": "lua", "python3-bandit": "bandit", "ruby3.1": "ruby",
"xz-utils": "xz"}
renames = {"lua5.3": "lua", "python3-bandit": "bandit", "xz-utils": "xz"}
tools_ = [renames.get(tool, tool) for tool in tools_]
install_command = ["dnf", "-y", "install"]
elif "ID=arch\n" in os_release_lines:
@ -1154,8 +1165,8 @@ def install_all_tools():
tools_.remove("python3-pdfminer") # pdf2txt is not in arch
tools_.remove("perl-doc") # perldoc is in perl but not in the path
tools_.remove("7zip")
renames = {"genisoimage": "cdrkit", "lua5.3": "lua", "ruby3.1": "ruby", "xz-utils": "xz",
"g++": "gcc", "golang-go": "go", "lua-check": "luacheck", "php-cli": "php",
renames = {"genisoimage": "cdrkit", "lua5.3": "lua", "xz-utils": "xz", "g++": "gcc",
"golang-go": "go", "lua-check": "luacheck", "php-cli": "php",
"pylint": "python-pylint", "python3-bandit": "bandit", "python3-mypy": "mypy"}
tools_ = [renames.get(tool, tool) for tool in tools_]
tools_ = ["python-" + tool[len("python3-"):] if tool.startswith("python3-") else tool
@ -1164,8 +1175,8 @@ def install_all_tools():
elif "ID=alpine\n" in os_release_lines:
tools_.remove("python3-bandit")
tools_.remove("wabt")
renames = {"genisoimage": "cdrkit", "lua5.3": "lua", "ruby3.1": "ruby", "xz-utils": "xz",
"g++": "gcc", "golang-go": "go", "lua-check": "luacheck", "php-cli": "php",
renames = {"genisoimage": "cdrkit", "lua5.3": "lua", "xz-utils": "xz", "g++": "gcc",
"golang-go": "go", "lua-check": "luacheck", "php-cli": "php",
"pylint": "py3-pylint", "tidy": "tidyhtml"}
tools_ = [renames.get(tool, tool) for tool in tools_]
tools_ = ["py3-" + tool[len("python3-"):] if tool.startswith("python3-") else tool

View file

@ -437,7 +437,7 @@ def git_log(path):
def make_tool_function(dependencies, command, url=None, error_status=None,
has_color=False, timeout=None):
has_color=False, timeout=None, patch_command=None):
if url is None:
url = dependencies[0]
command_parts = command.split()
@ -448,6 +448,7 @@ def make_tool_function(dependencies, command, url=None, error_status=None,
def func(path):
return _run_command(command_parts + [path], error_status, has_color, timeout)
func.command = command
func.patch_command = patch_command
return func

View file

@ -96,12 +96,14 @@ tools_for_extensions = [
dependencies = ["black"]
url = "https://github.com/psf/black"
command = "black --check --diff --color"
patch_command = "black --diff"
has_color = true
[isort]
dependencies = ["python3-isort", "python3-colorama"]
url = "https://pycqa.github.io/isort/"
command = "/usr/bin/python3 -m isort --check-only --diff --color"
patch_command = "/usr/bin/python3 -m isort --overwrite-in-place"
has_color = true
[perl_syntax]
@ -126,6 +128,7 @@ tools_for_extensions = [
dependencies = ["git"]
url = "https://git-scm.com/docs/git-diff"
command = "git diff --exit-code"
patch_command = "git checkout"
has_color = true
[git_blame]
@ -245,7 +248,7 @@ tools_for_extensions = [
command = "cppcheck --error-exitcode=1"
[ruby_syntax]
dependencies = ["ruby3.1"]
dependencies = ["ruby"]
url = "http://www.ruby-lang.org/"
command = "ruby -c"
@ -253,6 +256,7 @@ tools_for_extensions = [
dependencies = ["rubocop"]
url = "https://rubocop.org/"
command = "rubocop --color --fail-level autocorrect --display-style-guide"
patch_command = "rubocop --autocorrect"
has_color = true
[rustfmt]

View file

@ -15,7 +15,7 @@ import fill3.terminal as terminal
import termstr
__version__ = "v2025.06.14"
__version__ = "v2025.07.11"
##########################

View file

@ -2,7 +2,7 @@ tool.uv.package = true
[project]
name = "fill3"
version = "v2025.06.14"
version = "v2025.07.11"
description = "Fill3 provides basic widgets for a tui."
authors = [
{ name = "Andrew Hamilton", email = "and_hamilton@yahoo.com" },

View file

@ -15,7 +15,7 @@ import lscolors
import termstr
__version__ = "v2025.06.14"
__version__ = "v2025.07.11"
FILE_KEY = "fi"

View file

@ -7,7 +7,7 @@ allow-direct-references = true
[project]
name = "lscolors"
version = "v2025.06.14"
version = "v2025.07.11"
description = "Give coloring for file types as in the ls command."
authors = [
{ name = "Andrew Hamilton", email = "and_hamilton@yahoo.com" },

View file

@ -28,11 +28,11 @@ Eris can be installed by pipx or [uv](https://docs.astral.sh/uv/getting-started/
To install with pipx:
pipx install git+https://gitlab.com/ahamilton/eris@v2025.06.14
pipx install git+https://gitlab.com/ahamilton/eris@v2025.07.11
or to install with uv:
uv tool install git+https://gitlab.com/ahamilton/eris@v2025.06.14
uv tool install git+https://gitlab.com/ahamilton/eris@v2025.07.11
Then use eris to install all the tools it uses:

View file

@ -2,7 +2,7 @@ tool.uv.package = true
[project]
name = "eris"
version = "v2025.06.14"
version = "v2025.07.11"
description = "Eris maintains an up-to-date set of reports for every file in a codebase."
readme = "README.md"
authors = [
@ -11,13 +11,13 @@ authors = [
requires-python = ">=3.11"
dependencies = [
"docopt-ng==0.9.0",
"fill3 @ git+https://gitlab.com/ahamilton/eris@v2025.06.14#subdirectory=fill3",
"lscolors @ git+https://gitlab.com/ahamilton/eris@v2025.06.14#subdirectory=lscolors",
"fill3 @ git+https://gitlab.com/ahamilton/eris@v2025.07.11#subdirectory=fill3",
"lscolors @ git+https://gitlab.com/ahamilton/eris@v2025.07.11#subdirectory=lscolors",
"pexpect==4.9.0",
"pillow==11.2.1",
"pygments==2.19.1",
"pyinotify-elephant-fork==0.0.1",
"termstr @ git+https://gitlab.com/ahamilton/eris@v2025.06.14#subdirectory=termstr",
"termstr @ git+https://gitlab.com/ahamilton/eris@v2025.07.11#subdirectory=termstr",
]
[tool.uv.sources]

View file

@ -2,7 +2,7 @@ tool.uv.package = true
[project]
name = "termstr"
version = "v2025.06.14"
version = "v2025.07.11"
description = "Termstr provides strings with extra terminal styling."
authors = [
{ name = "Andrew Hamilton", email = "and_hamilton@yahoo.com" },

View file

@ -10,7 +10,7 @@ import weakref
import cwcwidth
__version__ = "v2025.06.14"
__version__ = "v2025.07.11"
ESC = "\x1b"

8
uv.lock generated
View file

@ -27,7 +27,7 @@ wheels = [
[[package]]
name = "eris"
version = "2025.6.14"
version = "2025.7.11"
source = { editable = "." }
dependencies = [
{ name = "docopt-ng" },
@ -54,7 +54,7 @@ requires-dist = [
[[package]]
name = "fill3"
version = "2025.6.14"
version = "2025.7.11"
source = { editable = "fill3" }
dependencies = [
{ name = "termstr" },
@ -65,7 +65,7 @@ requires-dist = [{ name = "termstr", editable = "termstr" }]
[[package]]
name = "lscolors"
version = "2025.6.14"
version = "2025.7.11"
source = { editable = "lscolors" }
dependencies = [
{ name = "termstr" },
@ -171,7 +171,7 @@ sdist = { url = "https://files.pythonhosted.org/packages/d6/b4/b44fccc7040b01449
[[package]]
name = "termstr"
version = "2025.6.14"
version = "2025.7.11"
source = { editable = "termstr" }
dependencies = [
{ name = "cwcwidth" },