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

Update #14

Merged
merged 6 commits into from
Mar 3, 2022
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
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
runner:
- ubuntu-latest
version:
- "1.14.0"
- "1.17.1"
- "1.x"
runs-on: ${{ matrix.runner }}
steps:
Expand Down
40 changes: 30 additions & 10 deletions .github/workflows/udd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,37 @@ jobs:
- uses: denoland/setup-deno@v1
with:
deno-version: "1.x"
- run: |
make tools
make update
- name: Update dependencies
run: |
make deps > ../output.txt
env:
NO_COLOR: 1
- name: Read ../output.txt
id: log
uses: juliangruber/read-file-action@v1
with:
path: ../output.txt
- name: Commit changes
run: |
git config user.name '${{ github.actor }}'
git config user.email '${{ github.actor }}@users.noreply.github.com'
git commit -a -F- <<EOM
:package: Update Deno dependencies

Update dependencies by udd:

${{ steps.log.outputs.content }}

EOM
- uses: peter-evans/create-pull-request@v3
with:
commit-message: ":package: Update deno dependencies"
title: ":package: Update deno dependencies"
title: ":package: Update Deno dependencies"
body: |
Automated updates by [deno-udd](https://github.com/hayd/deno-udd)
and [create-pull-request](https://github.com/peter-evans/create-pull-request)
GitHub action
branch: update-deno-dependencies
author: GitHub <[email protected]>
The output of `make update` is

```
${{ steps.log.outputs.content }}
```
labels: automation
branch: automation/update-dependencies
delete-branch: true
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/.tools
/.deno
20 changes: 8 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
TOOLS := ${CURDIR}/.tools
TARGETS := $$(find . \( -name '*.ts' -or -name '*.md' \) -not -path './.deno/*')

.DEFAULT_GOAL := help

Expand All @@ -7,27 +7,23 @@ help:
perl -ne 'print if /^\w+.*##/;' | \
perl -pe 's/(.*):.*##\s*/sprintf("%-20s",$$1)/eg;'

tools: FORCE ## Install development tools
@mkdir -p ${TOOLS}
@deno install -A -f -n udd --root ${TOOLS} https://deno.land/x/[email protected]/main.ts

fmt: FORCE ## Format code
@deno fmt --ignore=.deno
@deno fmt --config deno.jsonc

fmt-check: FORCE ## Format check
@deno fmt --check --ignore=.deno
@deno fmt --check --config deno.jsonc

lint: FORCE ## Lint code
@deno lint --ignore=.deno
@deno lint --config deno.jsonc

type-check: FORCE ## Type check
@deno test --unstable --no-run $$(find . -name '*.ts' -not -name '.deno')
@deno test --unstable --no-run ${TARGETS}

test: FORCE ## Test
@deno test --unstable -A --jobs
@deno test --unstable -A --no-check --jobs

update: FORCE ## Update dependencies
@${TOOLS}/bin/udd $$(find . -name '*.ts' -not -name '.deno')
deps: FORCE ## Update dependencies
@deno run -A https://deno.land/x/[email protected]/main.ts ${TARGETS}
@make fmt

FORCE:
12 changes: 12 additions & 0 deletions deno.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"lint": {
"files": {
"exclude": [".deno"]
}
},
"fmt": {
"files": {
"exclude": [".deno"]
}
}
}
22 changes: 12 additions & 10 deletions denops/guise/editor.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { Denops } from "https://deno.land/x/denops_std@v2.1.3/mod.ts";
import * as autocmd from "https://deno.land/x/denops_std@v2.1.3/autocmd/mod.ts";
import * as anonymous from "https://deno.land/x/denops_std@v2.1.3/anonymous/mod.ts";
import * as batch from "https://deno.land/x/denops_std@v2.1.3/batch/mod.ts";
import * as fn from "https://deno.land/x/denops_std@v2.1.3/function/mod.ts";
import * as vars from "https://deno.land/x/denops_std@v2.1.3/variable/mod.ts";
import * as option from "https://deno.land/x/denops_std@v2.1.3/option/mod.ts";
import { deferred } from "https://deno.land/std@0.111.0/async/mod.ts";
import type { Denops } from "https://deno.land/x/denops_std@v3.1.4/mod.ts";
import * as autocmd from "https://deno.land/x/denops_std@v3.1.4/autocmd/mod.ts";
import * as anonymous from "https://deno.land/x/denops_std@v3.1.4/anonymous/mod.ts";
import * as batch from "https://deno.land/x/denops_std@v3.1.4/batch/mod.ts";
import * as fn from "https://deno.land/x/denops_std@v3.1.4/function/mod.ts";
import * as vars from "https://deno.land/x/denops_std@v3.1.4/variable/mod.ts";
import * as option from "https://deno.land/x/denops_std@v3.1.4/option/mod.ts";
import { deferred } from "https://deno.land/std@0.128.0/async/mod.ts";

/**
* Open a scratch buffer in a new tab page and return immediately.
Expand All @@ -18,8 +18,10 @@ export async function open(denops: Denops): Promise<void> {
* Open a `filename` buffer in a new tab page and wait the buffer is closed.
*/
export async function edit(denops: Denops, filename: string): Promise<void> {
let opener = await vars.g.get(denops, "guise_edit_opener", "tab drop");
await denops.cmd(`silent noswapfile ${opener} \`=filename\` | edit`, { filename });
const opener = await vars.g.get(denops, "guise_edit_opener", "tab drop");
await denops.cmd(`silent noswapfile ${opener} \`=filename\` | edit`, {
filename,
});
const [winid, bufnr] = await batch.gather(denops, async (denops) => {
await fn.win_getid(denops);
await fn.bufnr(denops);
Expand Down
16 changes: 8 additions & 8 deletions denops/guise/main.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { Denops } from "https://deno.land/x/denops_std@v2.1.3/mod.ts";
import * as batch from "https://deno.land/x/denops_std@v2.1.3/batch/mod.ts";
import * as helper from "https://deno.land/x/denops_std@v2.1.3/helper/mod.ts";
import * as vars from "https://deno.land/x/denops_std@v2.1.3/variable/mod.ts";
import * as unknownutil from "https://deno.land/x/unknownutil@v1.1.4/mod.ts";
import type { Denops } from "https://deno.land/x/denops_std@v3.1.4/mod.ts";
import * as batch from "https://deno.land/x/denops_std@v3.1.4/batch/mod.ts";
import * as helper from "https://deno.land/x/denops_std@v3.1.4/helper/mod.ts";
import * as vars from "https://deno.land/x/denops_std@v3.1.4/variable/mod.ts";
import * as unknownutil from "https://deno.land/x/unknownutil@v2.0.0/mod.ts";
import {
Session as VimSession,
} from "https://deno.land/x/[email protected]/mod.ts";
Expand Down Expand Up @@ -80,16 +80,16 @@ function getDispatcher(denops: Denops): Dispatcher {
},

edit(filename: unknown) {
unknownutil.ensureString(filename);
unknownutil.assertString(filename);
return editor.edit(denops, filename);
},

error(
exception: unknown,
throwpoint: unknown,
) {
unknownutil.ensureString(exception);
unknownutil.ensureString(throwpoint);
unknownutil.assertString(exception);
unknownutil.assertString(throwpoint);
const message = [exception, throwpoint].join("\n");
return helper.echo(denops, message);
},
Expand Down