Skip to main content

A nice lint runner

Project description

Fnug

image image image Actions status

Fnug is a command runner, well actually it's a terminal multiplexer (like tmux), but with a focus on running all your lint and test commands, at once, and displaying the result of those command. Confused? Watch the demo

screenshot

Features

  • User-friendly terminal interface, with 100% support for both keyboard and mouse navigation
  • Git integration, automatically select lints and tests that's should be run, based on what files have uncommitted changes
  • Track file changes, and selects commands based on the changed files
  • Terminal emulation with scroll back, for those really long error messages

Installation

Python 3.10 or later is required.

pipx or rye tool are highly recommended:

# Recommended
pipx install fnug
# (or with rye tool)
rye install fnug
# Via pip (NOT RECOMMENDED)
pip install fnug

Usage

To start fnug you only need to run it in a directory with a .fnug.yaml configuration file (or with the argument -c path/to/config.yaml)

Config

Fnug is controlled by a .fnug.yaml configuration file (or .fnug.json if thats more your speed).

Minimal example:

Runs a single commands

fnug_version: 0.1.0
name: fnug
commands:
  - name: hello
    cmd: echo world

Git selection example:

Uses git auto to select commands based on what files have uncommitted changes (reselect by pressing "g")

fnug_version: 0.1.0
name: fnug
commands:
  - name: hello
    cmd: echo world
    auto:
      git: true
      path:
        - "./"
      regex:
        - "\\.fnug\\.yaml$"

File watching example:

Uses file watching to monitor the file system for changes, and select commands accordingly, can be combined with git auto

fnug_version: 0.1.0
name: fnug
commands:
  - name: hello
    cmd: echo world
    auto:
      watch: true
      path:
        - "./"
      regex:
        - "\\.fnug\\.yaml$"

Advanced example:

View this projects .fnug.yaml file for an advanced example

Demo

https://github.com/nickolaj-jepsen/fnug/assets/1039554/8f8a4d34-8beb-4fb4-9bbc-6fd0a4a384be

Development

Build with Rye

Install dependencies

rye sync

Run in textual devmode

log terminal: rye run console fnug (debug) terminal: rye run debug

Run lint/tests

Use fnug of course 😄 (or rye run fnug)

Thanks

Made possible by:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fnug-0.0.23.tar.gz (31.8 kB view hashes)

Uploaded Source

Built Distribution

fnug-0.0.23-py3-none-any.whl (32.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page