Skip to content

Commit

Permalink
initial release
Browse files Browse the repository at this point in the history
  • Loading branch information
hubisan committed Aug 19, 2024
1 parent c0b9d7a commit 9412cd6
Show file tree
Hide file tree
Showing 15 changed files with 1,276 additions and 412 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ tramp
# Eldev
/.eldev/

# Eask
.eask/
dist/

# Flycheck
flycheck_*.el

Expand Down
12 changes: 4 additions & 8 deletions CHANGELOG.org
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,13 @@
* Changelog

** Planned

- =Added= Functions to show definitions and synonyms.
- =Added= Documentation for definitions.
- =Added= Functions to lookup and show definitions.
- =Added= Functions to retrieve German definitions for a word from [[https://www.dwds.de]]
*** TODO Functions to show definitions and synonyms at once

** Unreleased

** 0.1.0 - [2024-08-19 Mon]

- =Added= Documentation for synonyms.
- =Added= Functions to lookup and show synonyms.
- =Added= Functions to retrieve German synonyms for a word from [[https://www.openthesaurus.de/]].
Initial release after having used it for a while to sort of test.

** Remark

Expand Down
68 changes: 44 additions & 24 deletions CONTRIBUTING.org
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

** Bugs, Improvements and new Features

Go to issues page and make a new issue.
Go to the issues page and create a new issue.

Make sure to:

Expand All @@ -19,7 +19,7 @@ Remember to:
- Include only one feature in a pull request.
- Open an issue and mention your planned pull request.
- Add/update tests if needed.
- The tests must pass (see [[#testing][Testing]]).
- Ensure the tests pass (see [[#testing][Testing]]).
- Update [[./README.org][README.org]] if needed.
- Update the documentation in the [[./README.org][README.org]] if needed.
- Update [[./CHANGELOG.org][CHANGELOG.org]].
Expand All @@ -29,35 +29,55 @@ Remember to:
:CUSTOM_ID: testing
:END:

Uses [[https://github.com/doublep/eldev][Eldev]] which needs to be [[https://github.com/doublep/eldev#installation][installed]]. The tests are written with [[https://github.com/jorgenschaefer/emacs-buttercup][Buttercup]]. After pushing GitHub an action is triggered to automatically lint and runtests.
Uses [[https://emacs-eask.github.io/Getting-Started/Introduction/][Eask]], which needs to be [[https://emacs-eask.github.io/Getting-Started/Install-Eask/#-npm-cross-platform][installed]]. The tests are written with [[https://github.com/jorgenschaefer/emacs-buttercup][Buttercup]]. After pushing to GitHub, an action is triggered which calls ~make all~.

**** Testing locally

To test the package locally call the Makefile targets:
To test the package locally, call the Makefile target ~make test-local~.

| Target | Description |
|-----------------+------------------------------------------------------|
| make help | Show help for targets available |
| make all | Run tests, lint and compile |
| make test | Run tests |
| make test-as-is | Run tests and use as-is instead of packaged (eldev) |
| make lint | Run linters |
| make compile | Byte-compile to check for errors/warnings |
| make clean | Clean everything |
| make run-emacs | Run Emacs with package and dependencies installed |
To open Emacs with just the package installed run ~make emacs~. Like this you can test it interactively.

The output of Eldev is set to ~--quiet~. To produce more verbose output, run the make targets by setting the verbose parameter:
To see all make targets run ~make~.

#+BEGIN_SRC shell
make all verbose=--trace # very verbose
make all verbose=--verbose # verbose
#+END_SRC
***** Linters

When using ~make lint~, the following linters are used:

- package-lint
- elint
- checkdoc
- indent-lint
- relint

If you want to use another linter or call a linter separately, use ~eask lint <name of linter>~. To get the names just run ~eask lint~.

***** Test in Specific Emacs Version

It is possible to run an Eask command with specific Emacs version in a Docker container (Docker needs to be installed and configured to run without sudo).

It is also possible to run the test with another Emacs version like so (Docker needs to be installed):
To run the tests in a container use ~make docker-test emacs=29.4~.

To run an eask command in a docker container use:

#+BEGIN_SRC shell
# Run the test with Emacs version 25.3
eldev docker 25.3 test
# Launch Emacs 27.2 to test your package.
eldev docker 27.2 emacs
eask docker 29.4 test buttercup
#+END_SRC

- Unfortunately, I have not found a way to run the make targets (tried ~eask docker 29.4 exec make test~).

- Sometimes after using a docker image ~eask clean all~ gives a long error with ~permission denied~ or ~No such file or directory~ at the end. If this happens run ~eask docker 29.4 clean all~.

- ~eask docker 29.4 emacs~ doesn't seem to work. I was able to launch an Emacs with the following command. The volumne has to be changed depending on where your have cloned the repository to:

#+BEGIN_SRC shell
eask docker 29.4 package
eask docker 29.4 install
docker run --interactive --tty \
--volume ~/projects/coding/woerterbuch:/woerterbuch \
--workdir /woerterbuch \
--rm \
silex/emacs:29.4-ci-eask emacs \
--init-directory /woerterbuch/.eask/29.4
#+END_SRC


37 changes: 37 additions & 0 deletions Eask
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
; -*- mode: emacs-lisp; lexical-binding: t -*-

(eval-when-compile
(defvar sentence-end-double-space)
(defvar checkdoc-verb-check-experimental-flag))

;; Domain Specific Language
;; https://emacs-eask.github.io/DSL/
(package "woerterbuch"
"0.1.0"
"Lookup definitions and synonyms for German words")

(website-url "https://github.com/hubisan/woerterbuch")
(keywords "dictionary" "thesaurus" "convenience")
(license "GPLv3")

(package-file "woerterbuch.el")
(files "woerterbuch.el")

;; https://emacs-eask.github.io/DSL/#-source-alias
(source "gnu")
(source "nongnu")
(source "melpa")

;; https://emacs-eask.github.io/DSL/#-depends-on-package-name-rest-recipe
(depends-on "emacs" "29.1")

;; https://emacs-eask.github.io/DSL/#-development-rest-body
(development
(depends-on "buttercup")
(depends-on "with-simulated-input"))

;; Tell checkdoc not to demand two spaces after a period.
(setq sentence-end-double-space nil)

;; Dont' check docstring for correct verb use.
(setq checkdoc-verb-check-experimental-flag nil)
29 changes: 0 additions & 29 deletions Eldev

This file was deleted.

84 changes: 60 additions & 24 deletions Makefile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9412cd6

Please sign in to comment.