Browse Source

Initial commit

master
Drew Short 5 years ago
commit
3d4b75706f
  1. 5
      .dockerignore
  2. 1
      .gitignore
  3. 12
      .pyspelling.yml
  4. 26
      Dockerfile
  5. 5
      README.md
  6. 36
      check_spelling.sh
  7. 32
      pipeline.yml
  8. 1
      requirements.txt
  9. 1
      tag
  10. 11
      upload_pipeline.sh

5
.dockerignore

@ -0,0 +1,5 @@
README.md
pipeline.yml
tag
upload_pipeline.sh
venv/

1
.gitignore

@ -0,0 +1 @@
venv/

12
.pyspelling.yml

@ -0,0 +1,12 @@
spellchecker: aspell
matrix:
- name: renpy_dialogue
aspell:
lang: en
hunspell:
lang: en-us
dictionary:
wordlists:
- dictionary/en-custom.txt
output: dictionary/renpy_dialogue_en_custom.dic
encoding: utf-8

26
Dockerfile

@ -0,0 +1,26 @@
FROM python:3-slim
LABEL maintainer="Drew Short"
ARG PYSPELLING_VERSION=2.5.1
RUN mkdir -p /opt/checker \
/source
VOLUME /source
COPY . /opt/checker
RUN apt-get -y update \
&& apt-get -y --no-install-recommends install \
aspell \
aspell-en \
awk \
hunspell \
hunspell-en-us \
sed \
&& rm -Rf /var/lib/apt/lists/*
RUN python -m pip install -r /opt/checker/requirements.txt
WORKDIR /opt/checker

5
README.md

@ -0,0 +1,5 @@
# Ren'Py Dialogue Checker
[![Concourse](https://concourse.nulloctet.com/api/v1/teams/docker/pipelines/renpy-dialogue-checker/jobs/build-image/badge)](https://concourse.nulloctet.com/teams/docker/pipelines/renpy-dialogue-checker)
Docker image build for checking renpy dialogue

36
check_spelling.sh

@ -0,0 +1,36 @@
#!/usr/bin/env bash
set -e
usage(){
echo "usage: check_spelling.sh <source directory>"
exit 1
}
start_dir=$(pwd)
script_dir=$(dirname "$0")
cd "$script_dir"
target_dir="$1"
source_dir="$2"
cp .pyspelling.yml "$target_dir"
cd "$target_dir"
# Determine what to ignore
find "$source_dir" -type f -name "*.rpy" | xargs grep -Eno "#ignorespelling" | sed -r -e "s=${source_dir}==" | awk 'BEGIN {FS=":"}; {printf "^%s:%s\n", $1, $2}' > ignore_directives
# Find suspect words
pyspelling -n renpy_dialogue -S dialogue.txt | tail -n+4 | head -n -3 > suspect_words
# Print the suspect words
awk 'BEGIN {FS="\t"}; {printf "%s:%s\t%s\n", $4, $5, $3}' < dialogue.tab | column -ts $'\t' > pretty_dialogue.tab
echo "Ignored lines:"
grep -f ignore_directives pretty_dialogue.tab | grep --color -w -f suspect_words
printf "\nSuspected misspellings:\n"
grep -v -f ignore_directives pretty_dialogue.tab | grep --color -w -f suspect_words
cd "$start_dir"
exit 0

32
pipeline.yml

@ -0,0 +1,32 @@
---
resources:
- name: git-resource
type: git
icon: git
source:
uri: ssh://git@git.nulloctet.com:8437/docker/renpy-dialogue-checker.git
private_key: |
((pull_key))
ignore_paths:
- pipeline.yml
- upload_pipeline.sh
- README.md
- name: git-resource-image
type: docker-image
icon: docker
source:
repository: ((nexus_docker_write.host))/sothr/renpy-dialogue-checker
username: ((nexus_docker_write.username))
password: ((nexus_docker_write.password))
jobs:
- name: build-image
plan:
- get: git-resource
trigger: true
- put: git-resource-image
params:
build: git-resource
tag_file: git-resource/tag
tag_as_latest: true
get_params: {skip_download: true}

1
requirements.txt

@ -0,0 +1 @@
pyspelling==2.5.1

1
tag

@ -0,0 +1 @@
1.0.0

11
upload_pipeline.sh

@ -0,0 +1,11 @@
#!/usr/bin/env bash
TEAM=docker
PIPELINE=renpy-dialogue-checker
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
pushd "${DIR}" || true
fly -t ${TEAM} set-pipeline --pipeline ${PIPELINE} --config pipeline.yml
popd || true
Loading…
Cancel
Save