Skip to content

Commit

Permalink
chore: push v2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jdkato committed Dec 8, 2019
1 parent 48878f3 commit f176b5c
Show file tree
Hide file tree
Showing 3,031 changed files with 1,881,319 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ docs/public/

docs/content/styles.md

action/action_closed.go
rule/grammar_closed.go

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM alpine:3.7

# TODO: Install DITA-related deps
#
# See https://cloud.docker.com/repository/docker/jdkato/vale
RUN apk add --no-cache --update \
python3 \
asciidoctor \
&& pip3 install docutils

COPY bin/vale /bin
# Compatibility
COPY bin/vale /

ENV PATH="/bin:${PATH}"
ENTRYPOINT ["/bin/vale"]
5 changes: 5 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
source 'https://rubygems.org'

gem 'specific_install', '~> 0.3.3'
gem 'cucumber', '~> 2.3.0'
gem 'os', '~> 0.9.6'
32 changes: 32 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
GEM
remote: https://rubygems.org/
specs:
builder (3.2.3)
cucumber (2.3.3)
builder (>= 2.1.2)
cucumber-core (~> 1.4.0)
cucumber-wire (~> 0.0.1)
diff-lcs (>= 1.1.3)
gherkin (~> 3.2.0)
multi_json (>= 1.7.5, < 2.0)
multi_test (>= 0.1.2)
cucumber-core (1.4.0)
gherkin (~> 3.2.0)
cucumber-wire (0.0.1)
diff-lcs (1.3)
gherkin (3.2.0)
multi_json (1.12.1)
multi_test (0.1.2)
os (0.9.6)
specific_install (0.3.3)

PLATFORMS
ruby

DEPENDENCIES
cucumber (~> 2.3.0)
os (~> 0.9.6)
specific_install (~> 0.3.3)

BUNDLED WITH
1.13.7
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) 2016 - 2019 Joseph Kato

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.
102 changes: 102 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
LAST_TAG=$(shell git describe --abbrev=0 --tags)
CURR_SHA=$(shell git rev-parse --verify HEAD)

LDFLAGS=-ldflags "-s -w -X main.version=$(LAST_TAG)"
BUILD_DIR=./builds

.PHONY: data test lint cross install bump rules setup bench compare release

all: build

# make release tag=v0.4.3
release:
git tag $(tag)
git push origin $(tag)

build:
go build ${LDFLAGS} -o bin/vale

closed:
go build -tags closed ${LDFLAGS} -o bin/vale

build-win:
go build ${LDFLAGS} -o vale.exe
go-msi make --msi vale.msi --version $(LAST_TAG)

install:
go install ${LDFLAGS}

spell:
./bin/vale --glob='!*{Needless,Diacritical,DenizenLabels,AnimalLabels}.yml' rule styles

bench:
go test -bench=. -benchmem ./core ./lint ./check

compare:
cd lint && \
benchmany -n 5 -o new.txt ${CURR_SHA} && \
benchmany -n 5 -o old.txt ${LAST_TAG} && \
benchcmp old.txt new.txt && \
benchstat old.txt new.txt

lint:
gometalinter --vendor --disable-all \
--enable=deadcode \
--enable=ineffassign \
--enable=gosimple \
--enable=staticcheck \
--enable=goimports \
--enable=dupl \
--enable=misspell \
--enable=errcheck \
--enable=vet \
--enable=vetshadow \
--deadline=1m \
./core ./lint ./ui ./check

setup:
go get golang.org/x/perf/cmd/benchstat
go get golang.org/x/tools/cmd/benchcmp
go get github.com/aclements/go-misc/benchmany
go get -u github.com/alecthomas/gometalinter
go get -u github.com/jteeuwen/go-bindata/...
bundle install
gem specific_install -l https://github.com/jdkato/aruba.git -b d-win-fix

rules:
go-bindata -ignore=\\.DS_Store -pkg="rule" -o rule/rule.go rule/**/*.yml

data:
go-bindata -ignore=\\.DS_Store -pkg="data" -o data/data.go data/*.{dic,aff}

spath:
bash script/stylesPath.sh

test:
go test -race ./core ./lint ./check
cucumber

docker:
GOOS=linux GOARCH=amd64 go build ${LDFLAGS} -o bin/vale
docker login -u jdkato -p ${DOCKER_PASS}
docker build -f Dockerfile -t jdkato/vale:latest .
docker tag jdkato/vale:latest jdkato/vale:latest
docker push jdkato/vale

cross:
mkdir -p $(BUILD_DIR)

GOOS=linux GOARCH=amd64 go build ${LDFLAGS}
tar -czvf "$(BUILD_DIR)/vale_$(LAST_TAG)_Linux_64-bit.tar.gz" ./vale

rm -rf vale

GOOS=darwin GOARCH=amd64 go build ${LDFLAGS}
tar -czvf "$(BUILD_DIR)/vale_$(LAST_TAG)_macOS_64-bit.tar.gz" ./vale

rm -rf vale

GOOS=windows GOARCH=amd64 go build ${LDFLAGS}
zip -r "$(BUILD_DIR)/vale_$(LAST_TAG)_Windows_64-bit.zip" ./vale.exe

rm -rf vale.exe
26 changes: 26 additions & 0 deletions action/action.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package action

import (
"fmt"

"github.com/errata-ai/vale/check"
"github.com/errata-ai/vale/core"
)

// ListConfig prints Vale's active configuration.
func ListConfig(config *core.Config) error {
fmt.Println(core.DumpConfig(config))
return nil
}

// GetTemplate prints tamplate for the given extension point.
func GetTemplate(name string) error {
template := check.GetTemplate(name)
if template != "" {
fmt.Println(template)
} else {
fmt.Printf(
"'%s' not in %v!\n", name, check.GetExtenionPoints())
}
return nil
}
67 changes: 67 additions & 0 deletions action/action_open.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
// +build !closed

package action

import (
"github.com/errata-ai/vale/core"
)

// GetLibrary returns the latest style library.
func GetLibrary(config *core.Config) error {
return nil
}

// StartAddons starts all installed add-ons.
func StartAddons(config *core.Config) error {
return nil
}

// StopAddons stops all installed add-ons.
func StopAddons(config *core.Config, args []string) error {
return nil
}

// FetchAddon an external (compressed) resource.
func FetchAddon(config *core.Config, args []string) error {
return nil
}

// GetAddons lists all available add-ons.
func GetAddons(config *core.Config) error {
return nil
}

// InstallStyle installs the given style using its download link.
func InstallStyle(config *core.Config, args []string) error {
return nil
}

// ListDir prints all folders on the current StylesPath.
func ListDir(config *core.Config, path string) error {
return nil
}

// AddProject adds a new project to the current StylesPath.
func AddProject(cfg *core.Config, name string) error {
return nil
}

// RemoveProject deletes a project from the current StylesPath.
func RemoveProject(cfg *core.Config, name string) error {
return nil
}

// EditProject renames a project from the current StylesPath.
func EditProject(cfg *core.Config, args []string) error {
return nil
}

// UpdateVocab updates a vocab file for the given project.
func UpdateVocab(config *core.Config, args []string) error {
return nil
}

// GetVocab extracts a vocab file for a project.
func GetVocab(config *core.Config, args []string) error {
return nil
}
Loading

0 comments on commit f176b5c

Please sign in to comment.