-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into dogfood-bouncer
- Loading branch information
Showing
12 changed files
with
367 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,44 @@ | ||
{:output {:pattern "::{{level}} file={{filename}},line={{row}},col={{col}}::{{message}}"} | ||
:linters {:aliased-namespace-symbol {:level :warning} | ||
:consistent-alias {:aliases {clojure.edn edn | ||
clojure.java.io io | ||
clojure.math math | ||
clojure.set set | ||
clojure.walk walk | ||
clojure.zip zip | ||
clojure.core.async async | ||
clojure.data.csv csv | ||
clojure.data.xml xml | ||
clojure.tools.cli cli | ||
clojure.java.shell sh | ||
clojure.pprint pp | ||
clojure.spec.alpha spec | ||
clojure.string str | ||
clojure.core.matrix mat | ||
clojure.tools.logging log | ||
clojure.core.reducers r}} | ||
:docstring-leading-trailing-whitespace {:level :warning} | ||
:keyword-binding {:level :warning} | ||
:main-without-gen-class {:level :warning} | ||
:missing-docstring {:level :warning} | ||
:namespace-name-mismatch {:level :warning} | ||
:reduce-without-init {:level :warning} | ||
:redundant-fn-wrapper {:level :warning} | ||
:refer {:level :warning | ||
:exclude #{clojure.test cljs.test doo.runner}} | ||
:refer-all {:exclude #{clojure.test}} | ||
:shadowed-var {:level :warning} | ||
:single-key-in {:level :warning} | ||
:unresolved-symbol {:exclude [(clojure.test/is [match?]) | ||
clojure.test.check.clojure-test/defspec]} | ||
:unsorted-required-namespaces {:level :warning} | ||
:used-underscored-binding {:level :warning} | ||
:unused-value {:level :warning}}} | ||
{:exclude-files ".clj-kondo/imports/.*" | ||
:output {:pattern "::{{level}} file={{filename}},line={{row}},col={{col}}::{{message}}"} | ||
:ns-groups [{:pattern "\\*\\.experimental\\.\\*" | ||
:name experimental-features} | ||
{:pattern "\\*\\.impl" | ||
:name implementation-only}] | ||
:linters {:aliased-namespace-symbol {:level :warning} | ||
:consistent-alias {:aliases {clojure.edn edn | ||
clojure.java.io io | ||
clojure.math math | ||
clojure.set set | ||
clojure.walk walk | ||
clojure.zip zip | ||
clojure.core.async async | ||
clojure.data.csv csv | ||
clojure.data.xml xml | ||
clojure.tools.cli cli | ||
clojure.java.shell sh | ||
clojure.pprint pp | ||
clojure.spec.alpha spec | ||
clojure.string str | ||
clojure.core.matrix mat | ||
clojure.tools.logging log | ||
clojure.core.reducers r}} | ||
:discouraged-var {clojure.core/read-string {:message "Use `clojure.edn/read-string` instead of `read-string`."}} | ||
:discouraged-namespace {experimental-features {:message "These functions are considered experimental and can break or change implementation in future releases."} | ||
implementation-only {:message "These functions are considered internal implementation details and are not part of their respective public api."}} | ||
:docstring-leading-trailing-whitespace {:level :warning} | ||
:keyword-binding {:level :warning} | ||
:main-without-gen-class {:level :warning} | ||
:missing-docstring {:level :warning} | ||
:namespace-name-mismatch {:level :warning} | ||
:reduce-without-init {:level :warning} | ||
:redundant-fn-wrapper {:level :warning} | ||
:refer {:level :warning | ||
:exclude #{clojure.test cljs.test doo.runner}} | ||
:refer-all {:exclude #{clojure.test}} | ||
:shadowed-var {:level :warning} | ||
:single-key-in {:level :warning} | ||
:unresolved-symbol {:exclude [(clojure.test/is [match?]) | ||
clojure.test.check.clojure-test/defspec]} | ||
:unsorted-required-namespaces {:level :warning} | ||
:used-underscored-binding {:level :warning} | ||
:unused-value {:level :warning}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
{:files {:extensions #{"clj" "cljs" "cljc" "cljx" "edn"} | ||
:ignore #{"target" ".git" ".idea" ".vscode" "node_modules"}} | ||
:rules {:namespaces {:enabled? false}}} | ||
:ignore #{"target" ".git" ".idea" ".vscode" "node_modules" ".clj-kondo" ".calva" ".lsp"}} | ||
:rules {:namespaces {:enabled? false} | ||
:indentation {:indents {#"defspec" [[:inner 0]] | ||
#"defstate" [[:inner 0]] | ||
#"for-all" [[:inner 0]]}}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
# Proposed Changes | ||
|
||
Quickly describe your change and the rationale behind it. | ||
Please link to any relevant issues or discussions. | ||
|
||
- Additions: | ||
- Updates: | ||
- Deletions: | ||
|
||
## Pre-merge Checklist | ||
|
||
- [ ] Write + run tests | ||
- [ ] Read and agree to the Contribution Guidelines and Code of Conduct | ||
- [ ] Write new tests for the changed functionality | ||
- [ ] Update CHANGELOG and increment version | ||
- [ ] Update README and relevant documentation |
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
# Barring any major exception, all Wall Brew Developers should be maintainers of any file | ||
* @Wall-Brew-Co/wall-brew-developers | ||
|
||
## This file was automatically copied and populated by rebroadcast | ||
|
||
## Do not edit this file directly, instead modify the source at <https://github.com/Wall-Brew-Co/rebroadcast/blob/master/sources/community/CODEOWNERS> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Symbolic Keywords | ||
|
||
In many clojure libraries, the behavior of complex functions may be controlled by a map. | ||
For example: | ||
|
||
```clojure | ||
(:require [brewtility.units :as units]) | ||
(units/display :volume 1.5 :liter) ;; => "1.5 l" | ||
(units/display :volume 1.5 :liter {:suffix :full}) ;; => "1.5 liter" | ||
``` | ||
|
||
This allows us to easily extend the definition of a single function to fulfill multiple complex needs; however, option maps come with considerable drawbacks. | ||
When a map is keyed with keywords, it is easy to introduce subtle, hard-to-detect errors. | ||
Since most of these functions select default values for keys not present, typos can lead to meaningful differences in behavior. | ||
For example: | ||
|
||
```clojure | ||
(:require [brewtility.units :as units]) | ||
(units/display :volume 1.5 :liter) ;; => "1.5 l" | ||
|
||
;; Note the missing "f" in the key :sufix | ||
(units/display :volume 1.5 :liter {:sufix :full}) ;; => "1.5 l" | ||
``` | ||
|
||
Because keywords aren't picked up by the auto-complete features of most editors, they're vulnerable to all classes of transpositional errors. | ||
Further, the options themselves are unable to carry metadata and documentation with them, making them little more than magic values. | ||
|
||
For this reason, it is helpful for libraries to include symbols which point to the "magic" keywords used in option maps. | ||
This has several benefits: | ||
|
||
- Misspelled or incorrect option keys are compile-time errors, instead of runtime bugs | ||
- Symbols can carry metadata like documentation, deprecation notices, and point to alternative options | ||
- Context-aware editors can auto-complete options | ||
|
||
Here's an example: | ||
|
||
```clojure | ||
(:require [brewtility.units :as units] | ||
[brewtility.units.options :as options]) | ||
|
||
(units/display options/volume 1.5 options/liter) ;; => "1.5 l" | ||
(units/display options/volume 1.5 options/liter {options/suffix options/full}) ;; => "1.5 liter" | ||
``` | ||
|
||
These keywords are available in the namespaces ending in `.options`. | ||
These files live as close to the code relying on them as possible; | ||
for example, the options for all unit conversion operations (e.g. `brewtility.units`, `brewtility.units.time`, `brewtility.units.color`, etc.) are available in `brewtility.units.options`. | ||
|
||
Further, the keywords in these namespaces are strictly preferred for library development. | ||
A single source of truth for the name of a common option, such as `precision`, limits the possibility of incorrectly retrieving the values used by that option. | ||
|
||
<!-- This file was automatically copied and populated by rebroadcast --> | ||
<!-- Do not edit this file directly, instead modify the source at https://github.com/Wall-Brew-Co/rebroadcast/blob/master/sources/community/documentation/clojure/patterns/symbolic_keywords.md --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
# Required Tooling | ||
|
||
Development at Wall Brew currently spans two primary programming languages: [clojure](https://clojure.org/) and [javascript.](https://www.javascript.com/) | ||
To build libraries and applications in those languages we use the two following build tools: | ||
|
||
* [Leiningen](https://leiningen.org/) | ||
* [npm](https://www.npmjs.com/) | ||
|
||
We highly recommend using your operating system's preferred package manager to install the following dependencies. | ||
If you do not have a preferred package manager, we currently recommend [Homebrew.](https://brew.sh/) | ||
|
||
For developers working on Windows machines, we strongly recommend the [Windows Subsystem for Linux (WSL).](https://learn.microsoft.com/en-us/windows/wsl/install) | ||
|
||
## Clojure Development | ||
|
||
### The Java Development Kit | ||
|
||
Since clojure is a hosted language within the JVM, a recent JDK is required. | ||
We recommend and develop against [OpenJDK](https://openjdk.org/) distributions. | ||
The following Homebrew command will install the most recent distribution: | ||
|
||
```sh | ||
brew install openjdk | ||
``` | ||
|
||
You can verify the installation with the following command: | ||
|
||
```sh | ||
$ java --version | ||
openjdk 21.0.2 2024-01-16 | ||
OpenJDK Runtime Environment Homebrew (build 21.0.2) | ||
OpenJDK 64-Bit Server VM Homebrew (build 21.0.2, mixed mode, sharing) | ||
``` | ||
|
||
If you plan on developing against or regression testing functionality against older JDK versions, we recommend installing [jenv.](https://www.jenv.be/) | ||
jenv can be installed with the following homebrew command: | ||
|
||
```sh | ||
brew install jenv | ||
``` | ||
|
||
You can verify the installation with the following command: | ||
|
||
```sh | ||
$ jenv versions | ||
* system (set by /some/local/path/.jenv/version) | ||
``` | ||
|
||
### Leiningen | ||
|
||
Leiningen manages clojure dependencies and tooling, and can be installed with the following homebrew command: | ||
|
||
```sh | ||
brew install leiningen | ||
``` | ||
|
||
You can verify the installation with the following command: | ||
|
||
```sh | ||
$ lein -v | ||
Leiningen 2.11.2 on Java 21.0.2 OpenJDK 64-Bit Server VM | ||
``` | ||
|
||
When working in a clojure repository, Leiningen will use a file named `project.clj` in the repository's root to declare library dependencies and tooling plugins. | ||
Leiningen will automatically download these as-needed while using default commands; however, they can be pre-fetched with the following: | ||
|
||
```sh | ||
lein deps | ||
``` | ||
|
||
Individual developer tools should be installed in `.lein/profiles.clj` | ||
A sample profile is provided below, but can be customized to your needs: | ||
|
||
```clj | ||
{:user {:plugin-repositories [["clojars" {:url "https://clojars.org/repo"}]] | ||
:git-dependencies [["https://github.com/tobyhede/monger.git"]] | ||
:plugins [[com.jakemccrary/lein-test-refresh "0.23.0"] | ||
[lein-cloverage "1.2.4"] | ||
[com.github.liquidz/antq "RELEASE"] | ||
[ns-sort "1.0.3"]] | ||
:test-refresh {:notify-command ["terminal-notifier" "-title" "Tests" "-message"]}}} | ||
``` | ||
|
||
Default developer tools will be installed in the `project.clj` file for each Wall Brew repository. | ||
|
||
## Clojurescript and Javascript Development | ||
|
||
### Node.js | ||
|
||
The Node Package Manager manages dependencies and tooling for our javascript projects and our clojurescript testing dependencies. | ||
It can be installed with the following homebrew command: | ||
|
||
```sh | ||
brew install node | ||
``` | ||
|
||
You can verify the installation with the following command: | ||
|
||
```sh | ||
$ npm version | ||
{ | ||
npm: '10.2.4', | ||
node: '21.6.2', | ||
... | ||
} | ||
``` | ||
|
||
<!-- This file was automatically copied and populated by rebroadcast --> | ||
<!-- Do not edit this file directly, instead modify the source at https://github.com/Wall-Brew-Co/rebroadcast/blob/master/sources/community/documentation/developing/001_required_tooling.md --> |
Oops, something went wrong.