Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add deno fmt #460

Merged
merged 4 commits into from
Sep 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions linters/deno/deno.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { linterFmtTest } from "tests";

linterFmtTest({ linterName: "deno" });
46 changes: 46 additions & 0 deletions linters/deno/plugin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
version: 0.1
downloads:
- name: deno
downloads:
- os:
macos: apple-darwin
cpu:
x86_64: x86_64
arm_64: aarch64
url: https://github.com/denoland/deno/releases/download/v${version}/deno-${cpu}-${os}.zip
- os:
linux: unknown-linux-gnu
windows: pc-windows-msvc
cpu:
x86_64: x86_64
url: https://github.com/denoland/deno/releases/download/v${version}/deno-${cpu}-${os}.zip
tools:
definitions:
- name: deno
download: deno
known_good_version: 1.36.4
shims:
- name: deno
target: deno
Comment on lines +22 to +24
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT:

Suggested change
shims:
- name: deno
target: deno
shims: [deno]

lint:
definitions:
- name: deno
files: [javascript, typescript, markdown, json]
commands:
- name: format
output: rewrite
run: deno fmt ${target}
success_codes: [0, 1]
cache_results: true
formatter: true
batch: true
in_place: true
tools: [deno]
suggest_if: config_present
direct_configs:
- deno.json
- deno.jsonc
known_good_version: 1.36.4
version_command:
parse_regex: deno ${semver} .*
run: deno --version
5 changes: 5 additions & 0 deletions linters/deno/test_data/basic.in.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export const identity = [
1, 0, 0,
0, 1, 0,
0, 0, 1,
];
16 changes: 16 additions & 0 deletions linters/deno/test_data/deno_v1.36.4_basic.fmt.shot
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Testing formatter deno test basic 1`] = `
"export const identity = [
1,
0,
0,
0,
1,
0,
0,
0,
1,
];
"
`;
9 changes: 5 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ trunk check enable {linter}
| HAML | [haml-lint] |
| HTML Templates | [djlint] |
| Java | [google-java-format], [pmd], [semgrep] |
| Javascript | [eslint], [prettier], [rome], [semgrep] |
| JSON | [eslint], [prettier], [semgrep] |
| Javascript | [deno], [eslint], [prettier], [rome], [semgrep] |
| JSON | [deno], [eslint], [prettier], [semgrep] |
| Kotlin | [detekt]<sup><a href="#note-detekt">1</a></sup>, [ktlint] |
| Kubernetes | [kube-linter] |
| Lua | [stylua] |
| Markdown | [markdownlint], [remark-lint] |
| Markdown | [deno], [markdownlint], [remark-lint] |
| Nix | [nixpkgs-fmt] |
| package.json | [sort-package-json] |
| Perl | [perlcritic], [perltidy] |
Expand All @@ -78,7 +78,7 @@ trunk check enable {linter}
| Terragrunt | [terragrunt] |
| Textproto | [txtpbfmt] |
| TOML | [taplo] |
| Typescript | [eslint], [prettier], [rome], [semgrep] |
| Typescript | [deno], [eslint], [prettier], [rome], [semgrep] |
| YAML | [prettier], [semgrep], [yamllint] |

[actionlint]: https://github.com/rhysd/actionlint#readme
Expand All @@ -98,6 +98,7 @@ trunk check enable {linter}
[codespell]: https://github.com/codespell-project/codespell#readme
[cspell]: https://github.com/streetsidesoftware/cspell#readme
[cue-fmt]: https://cuelang.org/
[deno]: https://deno.land/manual
[detekt]: https://github.com/detekt/detekt#readme
[djlint]: https://github.com/Riverside-Healthcare/djlint#readme
[dotenv-linter]: https://github.com/dotenv-linter/dotenv-linter#readme
Expand Down
Loading