Skip to content

Commit 89d9e99

Browse files
committed
First version
0 parents  commit 89d9e99

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+3495
-0
lines changed

.github/dependabot.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"

.github/workflows/lint.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: lint
2+
3+
on:
4+
pull_request:
5+
workflow_dispatch:
6+
push:
7+
paths-ignore:
8+
- "docs/**"
9+
- README.md
10+
- "releases/**"
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
lint:
17+
name: lint
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
- name: Setup go
23+
uses: actions/setup-go@v5
24+
with:
25+
go-version: "1.21"
26+
cache: false
27+
- name: Go linter
28+
uses: golangci/golangci-lint-action@v3
29+
with:
30+
version: v1.55
31+
args: --timeout=30m
32+
install-mode: binary

.github/workflows/release.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: release
2+
on:
3+
push:
4+
tags:
5+
- "v*"
6+
permissions:
7+
contents: write
8+
9+
jobs:
10+
release:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
- name: Set up Go
18+
uses: actions/setup-go@v5
19+
with:
20+
go-version: "1.21"
21+
- name: Run GoReleaser
22+
uses: goreleaser/goreleaser-action@v5
23+
with:
24+
distribution: goreleaser
25+
version: "1.22.0"
26+
args: release --clean
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: test
2+
3+
on:
4+
pull_request:
5+
workflow_dispatch:
6+
push:
7+
paths-ignore:
8+
- "docs/**"
9+
- README.md
10+
- "releases/**"
11+
12+
jobs:
13+
test:
14+
name: Test
15+
strategy:
16+
matrix:
17+
platform:
18+
- ubuntu-latest
19+
- macos-latest
20+
- windows-latest
21+
runs-on: ${{matrix.platform}}
22+
steps:
23+
- name: Install Go
24+
uses: actions/setup-go@v5
25+
with:
26+
go-version: "1.21"
27+
- name: Checkout code
28+
uses: actions/checkout@v4
29+
30+
- name: Test
31+
run: go test ./...

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/mdcode
2+
/mdcode.exe
3+
/build

.golangci.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
linters:
2+
enable-all: true
3+
fast: false
4+
disable:
5+
# deprecated
6+
- scopelint
7+
- varcheck
8+
- exhaustivestruct
9+
- ifshort
10+
- structcheck
11+
- deadcode
12+
- nosnakecase
13+
- maligned
14+
- golint
15+
- interfacer
16+
# disabled
17+
- wrapcheck
18+
19+
20+
linters-settings:
21+
depguard:
22+
rules:
23+
prevent_unmaintained_packages:
24+
files:
25+
- $all
26+
- "!$test"
27+
allow:
28+
- $gostd
29+
- github.com/google/shlex
30+
- github.com/yuin/goldmark
31+
- github.com/yuin/goldmark/ast
32+
- github.com/yuin/goldmark/text
33+
- github.com/rodaine/table
34+
- github.com/spf13/cobra
35+
- github.com/gobwas/glob
36+
- github.com/liamg/memoryfs
37+
- github.com/szkiba/mdcode/internal
38+
deny:
39+
- pkg: io/ioutil
40+
desc: "replaced by io and os packages since Go 1.16: https://tip.golang.org/doc/go1.16#ioutil"
41+
42+
run:
43+
skip-dirs:
44+
- "examples"

.goreleaser.yaml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
project_name: mdcode
2+
before:
3+
hooks:
4+
- go mod tidy
5+
dist: build/dist
6+
builds:
7+
- env:
8+
- CGO_ENABLED=0
9+
goos: ["darwin", "linux", "windows"]
10+
goarch: ["amd64", "arm64"]
11+
ldflags:
12+
- '-s -w -X {{.ModulePath}}/internal/cmd.version={{.Version}} -X {{.ModulePath}}/internal/cmd.appname={{.ProjectName}}'
13+
source:
14+
enabled: true
15+
name_template: "{{ .ProjectName }}_{{ .Version }}_source"
16+
17+
archives:
18+
- id: bundle
19+
format: tar.gz
20+
format_overrides:
21+
- goos: windows
22+
format: zip
23+
24+
checksum:
25+
name_template: "{{ .ProjectName }}_{{ .Version }}_checksums.txt"
26+
27+
snapshot:
28+
name_template: "{{ incpatch .Version }}-next+{{.ShortCommit}}{{if .IsGitDirty}}.dirty{{else}}{{end}}"
29+
30+
changelog:
31+
sort: asc
32+
abbrev: -1
33+
filters:
34+
exclude:
35+
- "^chore:"
36+
- "^docs:"
37+
- "^test:"

.vscode/settings.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"go.lintTool": "golangci-lint",
3+
"go.lintFlags": ["--fast"],
4+
"[javascript]": {
5+
"editor.formatOnSave": true,
6+
"editor.insertSpaces": true,
7+
"editor.tabSize": 4,
8+
"editor.detectIndentation": false,
9+
"editor.defaultFormatter": "vscode.typescript-language-features"
10+
}
11+
}

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Iván Szkiba
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)