Skip to content
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
25 changes: 14 additions & 11 deletions .github/workflows/format.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,21 @@ on: [push, pull_request]
jobs:
format:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Install formatting tools
run: nix-env -f "<nixpkgs>" -iA nixpkgs-fmt treefmt2 biome yamlfmt mdformat taplo typos
- uses: actions/checkout@v6
- uses: DeterminateSystems/nix-installer-action@v21
- uses: DeterminateSystems/magic-nix-cache-action@v13
with:
use-flakehub: false
use-gha-cache: true
- name: Load devShell env into job
shell: bash
run: |
eval "$(nix print-dev-env --no-pure-eval --accept-flake-config .#ci)"
echo "PATH=$PATH" >> "$GITHUB_ENV"
- name: Run treefmt
uses: isbecker/treefmt-action@v1
uses: isbecker/treefmt-action@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
version: 'latest'
github-token: ${{ secrets.GITHUB_TOKEN }}
version: system
ci: true
config_file: '.treefmt.toml'
50 changes: 0 additions & 50 deletions .treefmt.toml

This file was deleted.

4 changes: 2 additions & 2 deletions .vscode-test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// .vscode-test.js
const { defineConfig } = require('@vscode/test-cli');
const { defineConfig } = require("@vscode/test-cli");

module.exports = defineConfig({ files: 'out/test/**/*.test.js' });
module.exports = defineConfig({ files: "out/test/**/*.test.js" });
4 changes: 2 additions & 2 deletions .vscode-test.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig } from '@vscode/test-cli';
import { defineConfig } from "@vscode/test-cli";

export default defineConfig({
files: 'out/test/**/*.test.js',
files: "out/test/**/*.test.js",
});
548 changes: 283 additions & 265 deletions LICENSE.md

Large diffs are not rendered by default.

18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@
<p align="center">

<a href="https://github.com/isbecker/treefmt-vscode/actions/workflows/release.yml">
<img alt="GitHub Actions Workflow Status" src="https://img.shields.io/github/actions/workflow/status/isbecker/treefmt-vscode/release.yml"></a>
<a href="https://github.com/isbecker/treefmt-vscode/releases">
<img alt="GitHub Release" src="https://img.shields.io/github/v/release/isbecker/treefmt-vscode">
<img alt="GitHub Actions Workflow Status" src="https://img.shields.io/github/actions/workflow/status/isbecker/treefmt-vscode/release.yml">
</a>
<a href="https://marketplace.visualstudio.com/items?itemName=ibecker.treefmt-vscode">
<img alt="VS Code Marketplace Downloads" src="https://img.shields.io/visual-studio-marketplace/d/ibecker.treefmt-vscode"></a>
<a href="https://marketplace.visualstudio.com/items?itemName=ibecker.treefmt-vscode">
<img alt="VS Code Marketplace Installs" src="https://img.shields.io/visual-studio-marketplace/i/ibecker.treefmt-vscode"></a>
<a href="https://github.com/isbecker/treefmt-vscode/releases">
<img alt="GitHub Release" src="https://img.shields.io/github/v/release/isbecker/treefmt-vscode">
</a>
<a href="https://marketplace.visualstudio.com/items?itemName=ibecker.treefmt-vscode">
<img alt="VS Code Marketplace Downloads" src="https://img.shields.io/visual-studio-marketplace/d/ibecker.treefmt-vscode">
</a>
<a href="https://marketplace.visualstudio.com/items?itemName=ibecker.treefmt-vscode">
<img alt="VS Code Marketplace Installs" src="https://img.shields.io/visual-studio-marketplace/i/ibecker.treefmt-vscode">
</a>

</p>

This VS Code extension provides integration with [treefmt](https://github.com/numtide/treefmt), a multi-language code formatter. It allows you to format your code based on the configuration defined in your `treefmt.toml` file.
Expand Down
10 changes: 7 additions & 3 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{
"$schema": "https://biomejs.dev/schemas/1.8.2/schema.json",
"organizeImports": {
"enabled": false
"$schema": "https://biomejs.dev/schemas/2.3.8/schema.json",
"assist": {
"actions": {
"source": {
"organizeImports": "on"
}
}
},
"linter": {
"enabled": true,
Expand Down
30 changes: 15 additions & 15 deletions esbuild.js
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
const esbuild = require("esbuild");

const production = process.argv.includes('--production');
const watch = process.argv.includes('--watch');
const production = process.argv.includes("--production");
const watch = process.argv.includes("--watch");

/**
* @type {import('esbuild').Plugin}
*/
const esbuildProblemMatcherPlugin = {
name: 'esbuild-problem-matcher',
name: "esbuild-problem-matcher",

setup(build) {
build.onStart(() => {
console.log('[watch] build started');
console.log("[watch] build started");
});
build.onEnd((result) => {
result.errors.forEach(({ text, location }) => {
console.error(`✘ [ERROR] ${text}`);
console.error(` ${location.file}:${location.line}:${location.column}:`);
console.error(
` ${location.file}:${location.line}:${location.column}:`,
);
});
console.log('[watch] build finished');
console.log("[watch] build finished");
});
},
};

async function main() {
const ctx = await esbuild.context({
entryPoints: [
'src/extension.ts'
],
entryPoints: ["src/extension.ts"],
bundle: true,
format: 'cjs',
format: "cjs",
minify: production,
sourcemap: !production,
sourcesContent: false,
platform: 'node',
outfile: 'dist/extension.js',
external: ['vscode'],
logLevel: 'silent',
platform: "node",
outfile: "dist/extension.js",
external: ["vscode"],
logLevel: "silent",
plugins: [
/* add to the end of plugins array */
esbuildProblemMatcherPlugin,
Expand All @@ -50,7 +50,7 @@ async function main() {
}
}

main().catch(e => {
main().catch((e) => {
console.error(e);
process.exit(1);
});
Loading