Skip to content

Commit

Permalink
Note pre-commit exception
Browse files Browse the repository at this point in the history
  • Loading branch information
CBroz1 committed Jul 12, 2024
1 parent fa00b82 commit d56763b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 12 deletions.
6 changes: 4 additions & 2 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# https://github.com/DavidAnson/markdownlint
# https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md
MD007: false # permit indenting 4 spaces instead of 2
MD007: # permit indenting 4 spaces instead of 2
indent: 4
start_indent: 4
MD013:
line_length: "80" # Line length limits
line_length: 80 # Line length limits
tables: false # disable for tables
code_blocks: false # disable for code blocks
MD025: false # permit adjacent headings
Expand Down
25 changes: 16 additions & 9 deletions docs/src/ForDevelopers/Reuse.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Coding for Reuse

<!--
NOTE: Code blocks are intentionally non-black-formatted.
Disable pre-commit mdformat-black if editing. Or commit with --no-verify.
https://github.com/hukkin/mdformat-black/issues/6
-->

*Reusing code requires that it be faster to read and change than it would be to
start from scratch.*

Expand All @@ -12,20 +18,19 @@ We can speed up that process by ...
5. Automating as much of the above as possible.

This document will covers these topics in detail, pulling from resources like
[Tidy First](https://www.oreilly.com/library/view/tidy-first/9781098151232/)
and
[Tidy First](https://www.oreilly.com/library/view/tidy-first/9781098151232/) and
[SOLID Principles](https://arjancodes.com/blog/solid-principles-in-python-programming/).
Experienced object-oriented developers may find these principles familiar.

## Predictable Formatting

- Many programming languages offer flexibility in how they are written.
- Tools like `black` and `isort` take away stylistic preferences in favor of
one norm.
- Strict line limits (e.g., 80) make it easier to do side by side comparisons
in git interfaces.
- Tools like `black` and `isort` take away stylistic preferences in favor of one
norm.
- Strict line limits (e.g., 80) make it easier to do side by side comparisons in
git interfaces.
- `black` is also useful for detecting an error on save - if it doesn't run on
what you wrote, there's an error somewhere.
what you wrote, there's an error somewhere.

Let's look at a few examples of the same code block formatted different ways...

Expand Down Expand Up @@ -210,8 +215,10 @@ class MyTable(dj.Computed):

### Embedding

- The process of stream of consciousness coding often generates an embedding trail from core out
- Our mental model of A -> B -> C -> D may actually read like `D( C( B( A )))` or ...
- The process of stream of consciousness coding often generates an embedding
trail from core out
- Our mental model of A -> B -> C -> D may actually read like `D( C( B( A )))`
or ...

1. Prepare for D
2. Open a loop for C
Expand Down
2 changes: 1 addition & 1 deletion docs/src/ForDevelopers/Schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ Each table can have a docstring that describes the table, and must have a

- `field : datatype` defines a column using a
[SQL datatype](https://datajoint.com/docs/core/datajoint-python/0.14/design/tables/attributes/)


- `->` indicates a foreign key reference to another table.

Expand Down

0 comments on commit d56763b

Please sign in to comment.