-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[bot] synced file(s) with Wall-Brew-Co/rebroadcast (#108)
- Loading branch information
1 parent
0420056
commit 789e229
Showing
8 changed files
with
315 additions
and
13 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,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 --> |
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 @@ | ||
# Managed Tooling | ||
|
||
The [Wall Brew Open Source Guidelines](https://github.com/Wall-Brew-Co/open-source) encourage a seamless and consistent developer experience. | ||
While we often think about the work required to provide the tools, documentation, and automation behind that experience; we would do ourselves a disservice to ignore the cost of maintaining these files across a growing number of repositories. | ||
To prevent individual repositories from falling out of sync, [rebroadcast](https://github.com/Wall-Brew-Co/rebroadcast) was established to be the primary source of truth for these files. | ||
This requires a degree of standardization across repositories, including the use of the following tools which back the capabilities replicated by rebroadcast. | ||
The below tools are automatically enabled in our CI/CD, and do not strictly require installation. | ||
|
||
## GitHub Actions | ||
|
||
Since all Wall Brew repositories are hosted on GitHub, we have adopted [GitHub Actions](https://docs.github.com/en/actions) for our CI/CD needs: | ||
|
||
- Executing tests against pull requests | ||
- Enforcing style and formatting guides | ||
- Releasing artifacts to public repositories | ||
|
||
## cljstyle | ||
|
||
[cljstyle](https://github.com/greglook/cljstyle) is used to automatically format all clojure(script) code at Wall Brew. | ||
Further, each application uses the same cljstyle configuration to maintain as consistent of a look and feel as possible. | ||
While the configuration is minimal, rebroadcasting the file minimizes the cost of any future extension or change. | ||
Generally, the configuration should only ever change if it would break or interfere with other developer tools. | ||
|
||
Our GitHub actions will automatically apply this formatting against commits in open pull requests. | ||
We recommend pulling these changes back to your local branch before continuing with further development. | ||
If you wish to run the formatter locally, you can follow their [installation guide.](https://github.com/greglook/cljstyle?tab=readme-ov-file#installation) | ||
|
||
## clj-kondo | ||
|
||
[clj-kondo](https://github.com/clj-kondo/clj-kondo) is used as the primary linting too for clojure(script) code at Wall Brew. | ||
Aside from a few special rules and hooks, most applications and all libraries, are generally able to leverage the same linter configuration. | ||
The configuration is designed to cleanly integrate with code quality tools, and to push developers towards consistent coding standards. | ||
Pull requests against Wall Brew repositories will report any linter violations to the author in pull request comments. | ||
|
||
Many language-aware editors and editor plugins have adopted clj-kondo as the default linter for clojure. | ||
If your IDE does not have this option, you can [use the leiningen plugin.](https://github.com/clj-kondo/clj-kondo/blob/master/doc/jvm.md#leiningen) | ||
|
||
## sealog | ||
|
||
[Sealog](https://github.com/Wall-Brew-Co/lein-sealog) is the default changelog management tool used at Wall Brew. | ||
All applications and libraries are able to leverage the same changelog configuration. | ||
The configuration is designed to enforce consistent Changelog and versioning standards. | ||
Prior to merging a releasable pull request, the author or a Wall Brew maintainer should increment the version, log notable changes, and regenerate the changelog. | ||
|
||
## Renovate | ||
|
||
Wall Brew currently uses [Renovate](https://docs.renovatebot.com/) to manage dependency updates. | ||
The default configuration is language agnostic, and is therefore available on every repository. | ||
It will automatically check for and submit pull requests for outdated libraries and tools. | ||
The Renovate configuration will also update the jobs in our GitHub Action Workflows defined in `rebroadcast`. | ||
|
||
<!-- 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/002_managed_tooling.md --> |
Oops, something went wrong.