Skip to content

Commit

Permalink
First version
Browse files Browse the repository at this point in the history
  • Loading branch information
szkiba committed Jan 8, 2024
0 parents commit 89d9e99
Show file tree
Hide file tree
Showing 68 changed files with 3,495 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
32 changes: 32 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: lint

on:
pull_request:
workflow_dispatch:
push:
paths-ignore:
- "docs/**"
- README.md
- "releases/**"

permissions:
contents: read

jobs:
lint:
name: lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v5
with:
go-version: "1.21"
cache: false
- name: Go linter
uses: golangci/golangci-lint-action@v3
with:
version: v1.55
args: --timeout=30m
install-mode: binary
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: release
on:
push:
tags:
- "v*"
permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.21"
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: "1.22.0"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31 changes: 31 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: test

on:
pull_request:
workflow_dispatch:
push:
paths-ignore:
- "docs/**"
- README.md
- "releases/**"

jobs:
test:
name: Test
strategy:
matrix:
platform:
- ubuntu-latest
- macos-latest
- windows-latest
runs-on: ${{matrix.platform}}
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: "1.21"
- name: Checkout code
uses: actions/checkout@v4

- name: Test
run: go test ./...
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/mdcode
/mdcode.exe
/build
44 changes: 44 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
linters:
enable-all: true
fast: false
disable:
# deprecated
- scopelint
- varcheck
- exhaustivestruct
- ifshort
- structcheck
- deadcode
- nosnakecase
- maligned
- golint
- interfacer
# disabled
- wrapcheck


linters-settings:
depguard:
rules:
prevent_unmaintained_packages:
files:
- $all
- "!$test"
allow:
- $gostd
- github.com/google/shlex
- github.com/yuin/goldmark
- github.com/yuin/goldmark/ast
- github.com/yuin/goldmark/text
- github.com/rodaine/table
- github.com/spf13/cobra
- github.com/gobwas/glob
- github.com/liamg/memoryfs
- github.com/szkiba/mdcode/internal
deny:
- pkg: io/ioutil
desc: "replaced by io and os packages since Go 1.16: https://tip.golang.org/doc/go1.16#ioutil"

run:
skip-dirs:
- "examples"
37 changes: 37 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
project_name: mdcode
before:
hooks:
- go mod tidy
dist: build/dist
builds:
- env:
- CGO_ENABLED=0
goos: ["darwin", "linux", "windows"]
goarch: ["amd64", "arm64"]
ldflags:
- '-s -w -X {{.ModulePath}}/internal/cmd.version={{.Version}} -X {{.ModulePath}}/internal/cmd.appname={{.ProjectName}}'
source:
enabled: true
name_template: "{{ .ProjectName }}_{{ .Version }}_source"

archives:
- id: bundle
format: tar.gz
format_overrides:
- goos: windows
format: zip

checksum:
name_template: "{{ .ProjectName }}_{{ .Version }}_checksums.txt"

snapshot:
name_template: "{{ incpatch .Version }}-next+{{.ShortCommit}}{{if .IsGitDirty}}.dirty{{else}}{{end}}"

changelog:
sort: asc
abbrev: -1
filters:
exclude:
- "^chore:"
- "^docs:"
- "^test:"
11 changes: 11 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"go.lintTool": "golangci-lint",
"go.lintFlags": ["--fast"],
"[javascript]": {
"editor.formatOnSave": true,
"editor.insertSpaces": true,
"editor.tabSize": 4,
"editor.detectIndentation": false,
"editor.defaultFormatter": "vscode.typescript-language-features"
}
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Iván Szkiba

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading

0 comments on commit 89d9e99

Please sign in to comment.