Skip to content

A linter for your backup shell scripts that implements the Language Server Protocol.

Notifications You must be signed in to change notification settings

mattkhan/alphabetical-backup-lsp

Repository files navigation

alphabetical-backup-lsp

A linter for your backup shell scripts that implements the Language Server Protocol. Currently integrated in a VSCode extension. Only supports linting bash scripts.

directories first. files later. The first argument (file/directory to be copied over) in alphebatical order within the f and d sections.

The d and f commands should be aliased to whatever copy command you'd like to use, e.g. rsync.

example

It may not be the most practical linter with the most idiomatic code, but it's been a fun, narrow scope project to introduce myself to Rust and explore Tree-sitter, LSPs, and VSCode extension development.

Lint rules

  • The first argument to f and d commands must be sorted in alphabetical order within their respective sections.
  • The first f command must appear after the last d command.
  • The first argument must be a string literal.
  • The first argument must exist.

Demo

asdf.mov

Sample bash script in docs/samples/.

Development

Run the extension locally:

npm i
cargo run
npm run compile

Open the VSCode debugger and use a project with a sample .sh file.

UX inspired by Rubocop's OrderedGems lint rule.

About

A linter for your backup shell scripts that implements the Language Server Protocol.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published