bunmicro 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/PORTING.md +34 -0
- package/README.md +153 -0
- package/bmi +5 -0
- package/bun.lock +17 -0
- package/bunmicro +5 -0
- package/hlw.md +5 -0
- package/package.json +18 -0
- package/runtime/colorschemes/atom-dark.micro +33 -0
- package/runtime/colorschemes/bubblegum.micro +31 -0
- package/runtime/colorschemes/cmc-16.micro +47 -0
- package/runtime/colorschemes/cmc-tc.micro +43 -0
- package/runtime/colorschemes/darcula.micro +34 -0
- package/runtime/colorschemes/default.micro +1 -0
- package/runtime/colorschemes/dracula-tc.micro +49 -0
- package/runtime/colorschemes/dukedark-tc.micro +38 -0
- package/runtime/colorschemes/dukelight-tc.micro +38 -0
- package/runtime/colorschemes/dukeubuntu-tc.micro +38 -0
- package/runtime/colorschemes/geany.micro +29 -0
- package/runtime/colorschemes/gotham.micro +29 -0
- package/runtime/colorschemes/gruvbox-tc.micro +29 -0
- package/runtime/colorschemes/gruvbox.micro +26 -0
- package/runtime/colorschemes/material-tc.micro +36 -0
- package/runtime/colorschemes/monokai-dark.micro +28 -0
- package/runtime/colorschemes/monokai.micro +34 -0
- package/runtime/colorschemes/one-dark.micro +39 -0
- package/runtime/colorschemes/railscast.micro +37 -0
- package/runtime/colorschemes/simple.micro +33 -0
- package/runtime/colorschemes/solarized-tc.micro +31 -0
- package/runtime/colorschemes/solarized.micro +30 -0
- package/runtime/colorschemes/sunny-day.micro +29 -0
- package/runtime/colorschemes/twilight.micro +40 -0
- package/runtime/colorschemes/zenburn.micro +30 -0
- package/runtime/help/actions.md +161 -0
- package/runtime/help/colors.md +421 -0
- package/runtime/help/commands.md +161 -0
- package/runtime/help/copypaste.md +149 -0
- package/runtime/help/defaultkeys.md +141 -0
- package/runtime/help/help.md +63 -0
- package/runtime/help/keybindings.md +760 -0
- package/runtime/help/linter.md +90 -0
- package/runtime/help/options.md +701 -0
- package/runtime/help/plugins.md +544 -0
- package/runtime/help/tutorial.md +112 -0
- package/runtime/jsplugins/chapter/chapter.js +108 -0
- package/runtime/jsplugins/diff/diff.js +46 -0
- package/runtime/jsplugins/example/example.js +108 -0
- package/runtime/jsplugins/linter/linter.js +281 -0
- package/runtime/plugins/autoclose/autoclose.lua +75 -0
- package/runtime/plugins/ftoptions/ftoptions.lua +17 -0
- package/runtime/plugins/literate/README.md +5 -0
- package/runtime/plugins/literate/literate.lua +55 -0
- package/runtime/plugins/status/help/status.md +21 -0
- package/runtime/plugins/status/status.lua +62 -0
- package/runtime/syntax/LICENSE +22 -0
- package/runtime/syntax/PowerShell.yaml +128 -0
- package/runtime/syntax/README.md +63 -0
- package/runtime/syntax/ada.yaml +43 -0
- package/runtime/syntax/apacheconf.yaml +59 -0
- package/runtime/syntax/arduino.yaml +101 -0
- package/runtime/syntax/asciidoc.yaml +51 -0
- package/runtime/syntax/asm.yaml +123 -0
- package/runtime/syntax/ats.yaml +99 -0
- package/runtime/syntax/awk.yaml +44 -0
- package/runtime/syntax/b.yaml +87 -0
- package/runtime/syntax/bat.yaml +57 -0
- package/runtime/syntax/c.yaml +60 -0
- package/runtime/syntax/caddyfile.yaml +23 -0
- package/runtime/syntax/cake.yaml +7 -0
- package/runtime/syntax/clojure.yaml +38 -0
- package/runtime/syntax/cmake.yaml +42 -0
- package/runtime/syntax/coffeescript.yaml +56 -0
- package/runtime/syntax/colortest.yaml +19 -0
- package/runtime/syntax/conky.yaml +17 -0
- package/runtime/syntax/cpp.yaml +91 -0
- package/runtime/syntax/crontab.yaml +36 -0
- package/runtime/syntax/crystal.yaml +72 -0
- package/runtime/syntax/csharp.yaml +52 -0
- package/runtime/syntax/css.yaml +44 -0
- package/runtime/syntax/csx.yaml +8 -0
- package/runtime/syntax/cuda.yaml +68 -0
- package/runtime/syntax/cython.yaml +52 -0
- package/runtime/syntax/d.yaml +121 -0
- package/runtime/syntax/dart.yaml +46 -0
- package/runtime/syntax/default.yaml +10 -0
- package/runtime/syntax/dockerfile.yaml +36 -0
- package/runtime/syntax/dot.yaml +29 -0
- package/runtime/syntax/elixir.yaml +30 -0
- package/runtime/syntax/elm.yaml +38 -0
- package/runtime/syntax/erb.yaml +42 -0
- package/runtime/syntax/erlang.yaml +45 -0
- package/runtime/syntax/fish.yaml +48 -0
- package/runtime/syntax/forth.yaml +34 -0
- package/runtime/syntax/fortran.yaml +64 -0
- package/runtime/syntax/freebsd-kernel.yaml +14 -0
- package/runtime/syntax/fsharp.yaml +48 -0
- package/runtime/syntax/gdscript.yaml +61 -0
- package/runtime/syntax/gemini.yaml +19 -0
- package/runtime/syntax/gentoo-ebuild.yaml +48 -0
- package/runtime/syntax/gentoo-etc-portage.yaml +23 -0
- package/runtime/syntax/git-commit.yaml +35 -0
- package/runtime/syntax/git-config.yaml +14 -0
- package/runtime/syntax/git-rebase-todo.yaml +19 -0
- package/runtime/syntax/gleam.yaml +69 -0
- package/runtime/syntax/glsl.yaml +26 -0
- package/runtime/syntax/gnuplot.yaml +15 -0
- package/runtime/syntax/go.yaml +62 -0
- package/runtime/syntax/godoc.yaml +17 -0
- package/runtime/syntax/golo.yaml +73 -0
- package/runtime/syntax/gomod.yaml +31 -0
- package/runtime/syntax/graphql.yaml +47 -0
- package/runtime/syntax/groff.yaml +30 -0
- package/runtime/syntax/groovy.yaml +111 -0
- package/runtime/syntax/haml.yaml +16 -0
- package/runtime/syntax/hare.yaml +52 -0
- package/runtime/syntax/haskell.yaml +52 -0
- package/runtime/syntax/hc.yaml +52 -0
- package/runtime/syntax/html.yaml +70 -0
- package/runtime/syntax/html4.yaml +25 -0
- package/runtime/syntax/html5.yaml +25 -0
- package/runtime/syntax/ini.yaml +23 -0
- package/runtime/syntax/inputrc.yaml +14 -0
- package/runtime/syntax/java.yaml +37 -0
- package/runtime/syntax/javascript.yaml +76 -0
- package/runtime/syntax/jinja2.yaml +19 -0
- package/runtime/syntax/json.yaml +39 -0
- package/runtime/syntax/jsonnet.yaml +92 -0
- package/runtime/syntax/julia.yaml +57 -0
- package/runtime/syntax/justfile.yaml +40 -0
- package/runtime/syntax/keymap.yaml +27 -0
- package/runtime/syntax/kickstart.yaml +16 -0
- package/runtime/syntax/kotlin.yaml +66 -0
- package/runtime/syntax/kvlang.yaml +67 -0
- package/runtime/syntax/ledger.yaml +14 -0
- package/runtime/syntax/lfe.yaml +17 -0
- package/runtime/syntax/lilypond.yaml +26 -0
- package/runtime/syntax/lisp.yaml +17 -0
- package/runtime/syntax/log.yaml +92 -0
- package/runtime/syntax/lua.yaml +111 -0
- package/runtime/syntax/mail.yaml +25 -0
- package/runtime/syntax/makefile.yaml +38 -0
- package/runtime/syntax/man.yaml +12 -0
- package/runtime/syntax/markdown.yaml +49 -0
- package/runtime/syntax/mc.yaml +23 -0
- package/runtime/syntax/meson.yaml +51 -0
- package/runtime/syntax/micro.yaml +34 -0
- package/runtime/syntax/mpdconf.yaml +13 -0
- package/runtime/syntax/msbuild.yaml +6 -0
- package/runtime/syntax/nanorc.yaml +16 -0
- package/runtime/syntax/nftables.yaml +30 -0
- package/runtime/syntax/nginx.yaml +22 -0
- package/runtime/syntax/nim.yaml +27 -0
- package/runtime/syntax/nix.yaml +32 -0
- package/runtime/syntax/nu.yaml +114 -0
- package/runtime/syntax/objc.yaml +60 -0
- package/runtime/syntax/ocaml.yaml +43 -0
- package/runtime/syntax/octave.yaml +83 -0
- package/runtime/syntax/odin.yaml +64 -0
- package/runtime/syntax/pascal.yaml +45 -0
- package/runtime/syntax/patch.yaml +14 -0
- package/runtime/syntax/peg.yaml +16 -0
- package/runtime/syntax/perl.yaml +58 -0
- package/runtime/syntax/php.yaml +60 -0
- package/runtime/syntax/pkg-config.yaml +12 -0
- package/runtime/syntax/po.yaml +12 -0
- package/runtime/syntax/pony.yaml +37 -0
- package/runtime/syntax/pov.yaml +21 -0
- package/runtime/syntax/privoxy-action.yaml +14 -0
- package/runtime/syntax/privoxy-config.yaml +10 -0
- package/runtime/syntax/privoxy-filter.yaml +12 -0
- package/runtime/syntax/proto.yaml +40 -0
- package/runtime/syntax/prql.yaml +84 -0
- package/runtime/syntax/puppet.yaml +22 -0
- package/runtime/syntax/python2.yaml +60 -0
- package/runtime/syntax/python3.yaml +62 -0
- package/runtime/syntax/r.yaml +32 -0
- package/runtime/syntax/raku.yaml +42 -0
- package/runtime/syntax/reST.yaml +18 -0
- package/runtime/syntax/renpy.yaml +15 -0
- package/runtime/syntax/rpmspec.yaml +43 -0
- package/runtime/syntax/ruby.yaml +73 -0
- package/runtime/syntax/rust.yaml +78 -0
- package/runtime/syntax/sage.yaml +60 -0
- package/runtime/syntax/scad.yaml +53 -0
- package/runtime/syntax/scala.yaml +33 -0
- package/runtime/syntax/sed.yaml +13 -0
- package/runtime/syntax/sh.yaml +69 -0
- package/runtime/syntax/sls.yaml +15 -0
- package/runtime/syntax/smalltalk.yaml +55 -0
- package/runtime/syntax/solidity.yaml +41 -0
- package/runtime/syntax/sql.yaml +35 -0
- package/runtime/syntax/stata.yaml +67 -0
- package/runtime/syntax/svelte.yaml +27 -0
- package/runtime/syntax/swift.yaml +103 -0
- package/runtime/syntax/systemd.yaml +16 -0
- package/runtime/syntax/tcl.yaml +18 -0
- package/runtime/syntax/terraform.yaml +87 -0
- package/runtime/syntax/tex.yaml +32 -0
- package/runtime/syntax/toml.yaml +56 -0
- package/runtime/syntax/twig.yaml +55 -0
- package/runtime/syntax/typescript.yaml +49 -0
- package/runtime/syntax/v.yaml +80 -0
- package/runtime/syntax/vala.yaml +26 -0
- package/runtime/syntax/verilog.yaml +60 -0
- package/runtime/syntax/vhdl.yaml +37 -0
- package/runtime/syntax/vi.yaml +31 -0
- package/runtime/syntax/vue.yaml +64 -0
- package/runtime/syntax/xml.yaml +37 -0
- package/runtime/syntax/xresources.yaml +14 -0
- package/runtime/syntax/yaml.yaml +34 -0
- package/runtime/syntax/yum.yaml +12 -0
- package/runtime/syntax/zig.yaml +52 -0
- package/runtime/syntax/zscript.yaml +72 -0
- package/runtime/syntax/zsh.yaml +52 -0
- package/src/buffer/buffer.js +126 -0
- package/src/buffer/loc.js +38 -0
- package/src/buffer/message.js +29 -0
- package/src/config/colorscheme.js +109 -0
- package/src/config/config.js +118 -0
- package/src/config/defaults.js +102 -0
- package/src/display/ansi-style.js +60 -0
- package/src/highlight/highlighter.js +237 -0
- package/src/highlight/parser.js +137 -0
- package/src/index.js +5942 -0
- package/src/lua/engine.js +38 -0
- package/src/platform/archive.js +50 -0
- package/src/platform/clipboard.js +160 -0
- package/src/platform/commands.js +140 -0
- package/src/plugins/js-bridge.js +902 -0
- package/src/plugins/manager.js +619 -0
- package/src/runtime/registry.js +89 -0
- package/src/screen/cell-buffer.js +81 -0
- package/src/screen/events.js +263 -0
- package/src/screen/screen.js +118 -0
- package/src/screen/vt100.js +391 -0
- package/src/shell/shell.js +70 -0
- package/todo.txt +359 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# Linter
|
|
2
|
+
|
|
3
|
+
The linter plugin runs a compiler or linter on your source code
|
|
4
|
+
and parses the resulting output so that the messages and line numbers
|
|
5
|
+
can be viewed from within micro. By default, the plugin supports the
|
|
6
|
+
following filetypes and linters:
|
|
7
|
+
|
|
8
|
+
* **c**: gcc
|
|
9
|
+
* **c++**: g++
|
|
10
|
+
* **d**: dmd
|
|
11
|
+
* **d**: ldc2
|
|
12
|
+
* **d**: gdc
|
|
13
|
+
* **go**: go build
|
|
14
|
+
* **go**: go vet
|
|
15
|
+
* **haskell**: hlint
|
|
16
|
+
* **java**: javac
|
|
17
|
+
* **javascript**: jshint
|
|
18
|
+
* **javascript**: eslint
|
|
19
|
+
* **literate**: lit
|
|
20
|
+
* **lua**: luacheck
|
|
21
|
+
* **nim**: nim
|
|
22
|
+
* **nix**: nix-linter
|
|
23
|
+
* **objective-c**: clang
|
|
24
|
+
* **python**: flake8
|
|
25
|
+
* **python**: mypy
|
|
26
|
+
* **python**: pyflakes
|
|
27
|
+
* **python**: pylint
|
|
28
|
+
* **python**: ruff
|
|
29
|
+
* **rust**: cargo clippy
|
|
30
|
+
* **shell**: shfmt
|
|
31
|
+
* **shell**: shellcheck
|
|
32
|
+
* **swift**: swiftc (MacOS and Linux only)
|
|
33
|
+
* **yaml**: yamllint
|
|
34
|
+
|
|
35
|
+
If the linter plugin is enabled and the file corresponds to one of
|
|
36
|
+
these filetypes, each time the buffer is saved, or when the `> lint`
|
|
37
|
+
command is executed, micro will run the corresponding utility in the
|
|
38
|
+
background and display the messages when it completes.
|
|
39
|
+
|
|
40
|
+
The linter plugin also allows users to extend the supported filetypes.
|
|
41
|
+
From inside another micro plugin, the function `linter.makeLinter` can
|
|
42
|
+
be called to register a new filetype. Here is the spec for the `makeLinter`
|
|
43
|
+
function:
|
|
44
|
+
|
|
45
|
+
`linter.makeLinter(name, filetype, cmd, args, errorformat, os, whitelist, domatch, loffset, coffset, callback)`
|
|
46
|
+
|
|
47
|
+
* **name**: name of the linter
|
|
48
|
+
* **filetype**: filetype to check for to use linter
|
|
49
|
+
* **cmd**: main linter process that is executed
|
|
50
|
+
* **args**: arguments to pass to the linter process
|
|
51
|
+
* use %f to refer to the current file name
|
|
52
|
+
* use %d to refer to the current directory name
|
|
53
|
+
* **errorformat**: how to parse the linter/compiler process output
|
|
54
|
+
%f: file, %l: line number, %m: error/warning message
|
|
55
|
+
* **os**: list of OSs this linter is supported or unsupported on
|
|
56
|
+
optional param, default: {}
|
|
57
|
+
* **whitelist**: should the OS list be a blacklist (do not run the linter for these OSs)
|
|
58
|
+
or a whitelist (only run the linter for these OSs)
|
|
59
|
+
optional param, default: false (should blacklist)
|
|
60
|
+
* **domatch**: should the filetype be interpreted as a lua pattern to match with
|
|
61
|
+
the actual filetype, or should the linter only activate on an exact match
|
|
62
|
+
optional param, default: false (require exact match)
|
|
63
|
+
* **loffset**: line offset will be added to the line number returned by the linter
|
|
64
|
+
useful if the linter returns 0-indexed lines
|
|
65
|
+
optional param, default: 0
|
|
66
|
+
* **coffset**: column offset will be added to the col number returned by the linter
|
|
67
|
+
useful if the linter returns 0-indexed columns
|
|
68
|
+
optional param, default: 0
|
|
69
|
+
* **callback**: function to call before executing the linter, if it returns
|
|
70
|
+
false the lint is canceled. The callback is passed the buf.
|
|
71
|
+
optional param, default: nil
|
|
72
|
+
|
|
73
|
+
Below is an example for including a linter for any filetype using
|
|
74
|
+
the `misspell` linter which checks for misspelled words in a file.
|
|
75
|
+
|
|
76
|
+
```lua
|
|
77
|
+
function init()
|
|
78
|
+
-- uses the default linter plugin
|
|
79
|
+
-- matches any filetype
|
|
80
|
+
linter.makeLinter("misspell", "", "misspell", {"%f"}, "%f:%l:%c: %m", {}, false, true)
|
|
81
|
+
end
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Here is an example for a more typical use-case, where the linter will only match one filetype (C in this case):
|
|
85
|
+
|
|
86
|
+
```lua
|
|
87
|
+
function init()
|
|
88
|
+
linter.makeLinter("gcc", "c", "gcc", {"-fsyntax-only", "-Wall", "-Wextra", "%f"}, "%f:%l:%c:.+: %m")
|
|
89
|
+
end
|
|
90
|
+
```
|