• Stars
    star
    233
  • Rank 172,230 (Top 4 %)
  • Language
    Rust
  • License
    MIT License
  • Created over 8 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A lightweight blazingly fast file watcher.

funzzy Crate version CI integration tests CI Checks

Yet another fancy watcher. (Inspired by antr / entr)

Configure execution of different commands using semantic YAML and Unix shell style pattern match.

See also funzzy.nvim

# .watch.yaml
# list here all the events and the commands that it should execute
# TIP: include '.watch.yaml' in your .git/info/exclude to ignore it.

- name: run my tests
  run: make test
  change: "tests/**"
  ignore: "tests/integration/**"

- name: Starwars
  run: telnet towel.blinkenlights.nl
  change: ".watch.yaml"

- name: say hello
  run: echo "hello on init"
  change: "./*.yaml"
  run_on_init: true

# Command templates for custom scripts
- name: run test & linter for a single file
  run: [
    "npm run lint -- {{filepath}}",
    "npm test -- $(echo '{{filepath}}' | sed -r 's/\.(j|t)sx?//')"
  ]
  change: ["src/**", "libs/**"]
  ignore: ["src/**/*.stories.*", "libs/**/*.log"]

Motivation

Create a lightweight watcher to run my tests every time something in my project change. So I won't forget to keep my tests passing. Funzzy was made with Rust which is why it consumes almost nothing to run.

Installing

  • OSX:
brew tap cristianoliveira/tap
brew update
brew install funzzy
  • Linux:
curl -s https://raw.githubusercontent.com/cristianoliveira/funzzy/master/linux-install.sh | sh
  • With Cargo
cargo install funzzy

*Make sure you have $HOME/.cargo/bin in your PATH export $PATH:$HOME/.cargo/bin

From source

Make sure you have installed the following dependencies:

  • Rust
  • Cargo

Execute:

cargo install --git https://github.com/cristianoliveira/funzzy.git

Or, clone this repo and run:

make install

Running

Initializing with boilerplate:

funzzy init

Change the YAML as you want. Then run:

funzzy

Filtering task by target:

funzzy --target="my task"

Run with some arbitrary command and stdin

find . -name '*.rs' | funzzy 'cargo build'

Templates for composing commands

find . -name '*.[jt]s' | funzzy 'npx eslint {{filepath}}'

See more on examples or in the integration specs

Troubleshooting

Why the watcher is running the same task multiple times?

This might be due to different causes, the most common issue when using VIM is because of the default backup setting which causes changes to multiple files on save. See Why does Vim save files with a ~ extension?. For such cases either disable the backup or ignore them in your watch rules.

For other cases use the verbose funzzy -V to understand what is triggering a task to be executed.

Automated tests

Running unit tests:

cargo test

or simple make tests

Running integration tests:

make integration

Code Style

We use clippy for linting the funzzy's source code. Make sure you had validated it before committing.

Contributing

  • Fork it!
  • Create your feature branch: git checkout -b my-new-feature
  • Commit your changes: git commit -am 'Add some feature'
  • Push to the branch: git push origin my-new-feature
  • Submit a pull request

Pull Requests are really welcome! Others support also.

Pull Request should have unit tests

License

This project was made under MIT License.

More Repositories

1

ergo

The management of multiple apps running over different ports made easy
Go
623
star
2

awesome4girls

A curated list of inclusive events/projects/initiatives for women in the tech area. πŸ’
Ruby
569
star
3

distributex

A POC of a federated architecture using HTMX & NGINX - micro-frontends/services (same thing)
HTML
64
star
4

awesome-byo

A curated list of open content for "building your own sth". πŸ› 
JavaScript
54
star
5

java-checkstyle

Git pre commit checkstyle java linter plugin
Ruby
33
star
6

rascal

A simple (almost)functional interpreted language made by Rust
Rust
17
star
7

apitogo

"An api to go, please." - Make a fake api without a line of code.
Go
15
star
8

croutera

Simple Cli Router Admin. To handle common Routers/Modems actions like login, restart, log in terminal.
Python
12
star
9

dotfiles

My dotfiles for OSX and NixOS. 😎 πŸ“¦
Shell
11
star
10

jafregle

A totally free google translate lib with java.
Java
9
star
11

datapoa-java-client

Data Poa Client Library for Java
Java
6
star
12

cowboy-elixir

Simple web hello world using Cowboy + Elixir (Bonus Heroku)
Elixir
5
star
13

gokoans

Resolution of the golang koans
Go
4
star
14

vim-tips

A bot for random vim tips that are posted on https://twitter.com/ClubVim
TypeScript
4
star
15

react-meets-tdd

When React meets TDD 🀝
JavaScript
4
star
16

nextjs-sumup-payments-starter

Example of how to use SumUp's Online Payment SDKs
TypeScript
3
star
17

react-lib-boilerplate

A boilerplate for creating react components as distributed node packages.
CSS
3
star
18

react-need-for-speed

A talk about metrics analysing, tools and best practices for performance optimisation
3
star
19

boulderando

Web app for scheduling and managing boulder sessions in Berlin
TypeScript
3
star
20

trustedshops-react

The trusted shops self-contained React component (Plug and play)
JavaScript
3
star
21

rufregle

A totally free google translate api gem
Ruby
3
star
22

homebrew-tap

Homebrew tap to distribute my apps.
Shell
2
star
23

FormsOracleAnalyzerLib

Lib to analyze Reporting objects Oracle Forms 6i. This class returns the components of fmb analyzed.
C#
2
star
24

vish-shell

A vim like shell. The features you like in vim in a shell.
Rust
2
star
25

react-address-factory

A sample app for the factory/strategy pattern blog post
JavaScript
2
star
26

toPlay

Template Platform to make gamification apps in Rails
Ruby
2
star
27

funzzy.nvim

Neovim plugin for spawning funzzy the watcher on demand
Lua
2
star
28

rost

A simple host manager in Rust.
Rust
2
star
29

pokemon-trivia

That's what we can do in 3 sprints of 1 hour each
JavaScript
2
star
30

snipgpt.nvim

Plugin to interact with snipgpt
Lua
2
star
31

bikeon-android-app

Open source app for urban mobility (Bike).
Java
2
star
32

knight_game

The game of knights
JavaScript
2
star
33

nixpkgs

Cristian Oliveira's nix packages
Nix
2
star
34

awesome4girls-api

The api for the cristianoliveira/awesome4girls project.
Ruby
2
star
35

challenges-ruby

Some challenges solved in ruby
Ruby
1
star
36

ifrone

A tiny wrapper around cross-window communication.
JavaScript
1
star
37

vim-circuit-ui-snippets

Useful snippets for working with Circui-ui
1
star
38

spike-gh-action-upload-asset

Nothing to see here
1
star
39

eurotrip

Route provider for your trip
Go
1
star
40

plsql_soap_oracle

Soap manager types for PL SQL Oracle
1
star
41

cristianoliveira.dev

My personal site
JavaScript
1
star
42

sumup-widget-nonce

Just a POC
JavaScript
1
star
43

boteam

A open source bot for teams in Slack.
JavaScript
1
star
44

api-boilerplate

An boilerplate for an api in go+ruby+elasticsearch using Dockerfile and Docker-Compose
Go
1
star
45

snipgpt

A pluggable CLI to generate short snippets using openai LLM
JavaScript
1
star
46

benchy

Some arbitrary benchmarks
Python
1
star
47

autobooker

JavaScript
1
star
48

vim-react-html-snippets

Vim plugin for html related snippets inside react components.
1
star
49

unfetch-issue-demo

JavaScript
1
star
50

js-dojos

Practicing solving problems
JavaScript
1
star
51

ip-api-proxy

Simple proxy for ip-api.com calls which is not https (see ipproxyfoo.herokuapp.com)
Ruby
1
star
52

git-lfs-file-manager

A file manager for repositories using Git Large Files
1
star
53

hosted-fields-poc

This project is a proof of concept for implementing a simple hosted fields sdk
JavaScript
1
star
54

obsh

[Ob][sh]idian a shell cli for managing with obsidian vaults
Shell
1
star