Skip to content

Commit

Permalink
Merge branch 'dev' into 'main'
Browse files Browse the repository at this point in the history
Dev

See merge request fstamour/breeze!47
  • Loading branch information
fstamour committed Jul 21, 2024
2 parents 1fadd31 + e0a4764 commit 43606cf
Show file tree
Hide file tree
Showing 122 changed files with 13,710 additions and 3,146 deletions.
13 changes: 13 additions & 0 deletions .dir-locals.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
;;; Directory Local Variables -*- no-byte-compile: t -*-
;;; For more information see (info "(emacs) Directory Variables")

((nil . ((eval . (progn
(setq-local org-roam-directory
(file-truename
(file-name-concat
(locate-dominating-file default-directory ".dir-locals.el")
"docs/")))
(setq-local org-roam-db-location
(file-name-concat org-roam-directory "org-roam.db"))))
(org-roam-capture-templates . (("d" "default" plain "%?" :target (file+head "${slug}.org" "#+title: ${title}
") :unnarrowed t))))))
25 changes: 17 additions & 8 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
scratch-files/
.git/
.github/
.githooks/
.gitattributes
.gitmodules
# *.core
*.dot
*.fasl
*.log
*.org
result
*.png
*.svg
*~
dockerfile
.dockerignore
.git/
.gitattributes
.githooks/
.github/
.gitignore
.gitmodules
/.direnv/
dockerfile
githooks/*.sample
public/
result
scratch-files/
2 changes: 1 addition & 1 deletion .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ GUIX_PKGS="make python-codespell"


if has guix; then
use guix --ad-hoc $PKGS_COMMON $GUIX_PKGS
use guix $PKGS_COMMON $GUIX_PKGS
elif has nix-shell; then
use nix -p $PKGS_COMMON $NIX_PKGS
fi
8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@
*.core
*.svg
result
docs/index.html
public/

# org-roam db
*.db

githooks/*.sample
/.direnv/
*.dot

*.png
*.log
*~
*~
/docs/sitemap.org
65 changes: 65 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@

# Only run pipelines for merge requests, tags, and protected branches.
workflow:
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_REF_PROTECTED == "true"

.base:
image: clfoundation/$LISP:latest
variables:
LISP: sbcl
QUICKLISP_ADD_TO_INIT_FILE: "true"
QUICKLISP_DIST_VERSION: "latest"
before_script:
- install-quicklisp
script:
- make test
rules:
- when: manual

test:
extends: .base
variables:
LISP: sbcl
parallel:
matrix:
- STACK:
- sbcl
# TODO
# - abcl
# - ccl
# - ecl


## The job "doc" will re-run the tests, but I'm keeping that
## redundancy because the job "test" will be expanded to work on
## multiple cl implementations.

# Build public/ folder using org-publish on docs/
doc:
image: docker:24.0.7
services:
- docker:24.0.5-dind
script:
- apk add --no-cache make
- make public
artifacts:
paths:
- public
rules:
- when: manual

pages:
needs:
- job: doc
artifacts: true
script:
- echo "nothing to do!"
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
- when: manual
artifacts:
paths:
- public
63 changes: 63 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
######################################################################
### Base layers, setup working directory and quicklisp
# FROM docker.io/clfoundation/${LISP}:${LISP_VERSION} as base
FROM alpine:3.18.4 as base

RUN mkdir /breeze
WORKDIR /breeze


FROM base as quicklisp

RUN apk add sbcl
COPY scripts/quicklisp.lisp scripts/quicklisp.lisp
RUN sbcl --non-interactive \
--load scripts/quicklisp.lisp \
--eval "(quicklisp-quickstart:install)" \
--eval "(ql-util:without-prompting (ql:add-to-init-file))"

######################################################################
### Download all needed dependencies (for the main and the test
### systems).
FROM quicklisp as deps

COPY breeze.asd .
COPY scripts/load-dependencies.lisp scripts/load-dependencies.lisp

RUN sbcl --noinform --non-interactive \
--load scripts/load-dependencies.lisp


FROM scratch as dependencies.core

COPY --from=deps /breeze/dependencies.core /dependencies.core

######################################################################
### Run the tests and generate some documentation
FROM quicklisp as test

COPY . .
RUN sbcl --core dependencies.core \
--eval "(asdf:test-system '#:breeze)"

FROM base as org-publish

RUN apk add bash ca-certificates emacs

COPY . .
COPY --from=test /breeze/docs /breeze/docs

RUN emacs -Q --batch --load scripts/org-publish-project.el --kill
RUN ls
RUN ls /breeze/public

FROM scratch as public

COPY --from=org-publish /breeze/public /


######################################################################
### This is where I left off

# FROM deps as integration-tests
# RUN emacs -batch -l ert -l my-tests.el -f ert-run-tests-batch-and-exit
154 changes: 2 additions & 152 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,162 +1,12 @@
# <a name="readme">Breeze</a>
# Breeze

Breeze is a set of tools that aims to make lisp development a breeze
(hence the name).

It is very much alpha quality, I'm experimenting with a lot of things
in parallel.

Please take a look at the
[notes.org](https://github.com/fstamour/breeze/blob/master/notes.org)
to get a better idea of the things I wanna try.

![ci](https://github.com/fstamour/breeze/actions/workflows/ci.yml/badge.svg)

[github.com/fstamour/breeze](https://github.com/fstamour/breeze)

## What is this?

This is a git repository that contains lots of common lisp code that I
use to make developing with common lisp easier. It is a personal
project that I work on from time to time, but that I use (and break)
pretty much all the time.

## Features

* [Emacs integration](#emacs)
* Integration with quickproject
* Context-aware, configurable snippets and refactorings
* Command for quick code capture (trying out code in a new file)
* Implemented in common lisp to be able to port it to other editors in
the future

Currently, breeze's main interface is emacs; `breeze.el` adds a few
commands and one minor-mode with one bindings (`C-.`).

The one binding calls a command named `breeze-quickfix` (might rename
in the future). This command suggests applicable actions given the
current context (file name, file content, position in the file,
etc.). For example, if the file ends with ".asd" it will suggest a
command to insert a `defsystem` form. If breeze was already
configured, it will pre-fill the `:maintainer`, `:author` and
`:licence` fields. Another example is that if the file is empty, or
contains only comments, it will suggest to insert a `defpackage` or
`uiop:define-package` form. It is also able to detect when you're
trying to edit/evaluate forms that are in a package that doesn't
exists (_did you forget to evaluate the `defpackage` form_).

The integration with quickproject is pretty simple and let's you
quickly create new projects from the comfort of your editor. The
integration consists of one command that asks you for some
information, like the project name and licence. It takes some default
values from breeze's configuration, but let's you change them. All
this to ease the use of quickproject.

Another simple command that helps me is `breeze-capture`, it creates a
new file in a pre-determined (must be configured) folder and fills it
with some pre-configured content (template) and let's you code right
away. This could've easily be done in emacs (that's how I prototyped
the first version), but doing this in common lisp makes it easy to
port it to other editors (or just the repl) in the future.

I must stress that this whole project is in constant flux, and until I
add more and more tests, stuff might break any time.

## Goals and non-goals

### Goals

- Make it easier to develop in common lisp
- by any means
- With any editor (or even without one)
- Be as portable as possible
- Be useful to new and experimented developer (or even
non-developpers, we'll get there)

### Non-goals

- Replace slime, sly, slimv, slima, etc
- Replace existing test framework
- Force the user to use a set of conventions
- If there are conventions used by breeze it is only for convenience
and they should be customizable.
- e.g. Currently, some refactoring utilities only work when the user
use `cl:defpackage` (as opposed to `uiop:defpackage`) and there's
one `defpackage` per file, but it doesn't have to be that way.

## Getting started

1. Clone this repository in quicklisp's local-projects folder.

2. Load the `breeze` system. From the repl:

(ql:quickload "breeze")

3. Load `<breeze>/src/breeze.el` in emacs.

And enable `breeze-mode` minor mode in `lisp-mode` automatically using
a hook:

(add-hook 'lisp-mode-hook #'breeze-mode)

Now you should be able to use `C-.` (control + period) in any lisp
buffer to bring up the "quickfix menu".

### Configuring breeze

> This is optional, but it will help make breeze more to your liking.
Simply put this in your implementation's initialization file
(e.g. `~/.sbclrc` for sbcl). In the future, breeze might use it's own
configuration folder, but for now this will do.


(require '#:breeze.config)

(setf breeze.config:*default-author* "your name"
breeze.config:*capture-folder* #p"~/capture/")

### How to run the tests

From the repl:

(ql:quickload "breeze/test")
(asdf:test-system "breeze")


Or from the command line:

./scripts/test.sh

### How to generate the documentation

From the repl:

(breeze.documentation::generate-documentation)

Or from the command line:

./scripts/doc.sh

With either method, the documentation is generated into to `docs/`
folder.

### Contributing

Start by forking and cloning this repository into quicklisp's
local-projects directory.

Setup the pre-commit hook

git config core.hooksPath githooks

Look for TODOs in the code

grep -ir --include='*.lisp' todo
# or
rg -i todo

Peruse the [notes.org](notes.org).
More information in the [documentation](https://fstamour.gitlab.io/breeze/).

## Support me

Expand Down
Loading

0 comments on commit 43606cf

Please sign in to comment.