Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add codespell support (config, workflow to detect/not fix) and make it fix few typos #78

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[codespell]
# Ref: https://github.com/codespell-project/codespell#using-a-config-file
skip = .git*,*.svg,.codespellrc,*.html
check-hidden = true
# Some case sensitive names and too long "words" without spaces (usually some encodings)
ignore-regex = \b(Carin|Shure)\b|[^ \t]{50,}
ignore-words-list = crate
25 changes: 25 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Codespell configuration is within .codespellrc
---
name: Codespell

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read

jobs:
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Annotate locations with typos
uses: codespell-project/codespell-problem-matcher@v1
- name: Codespell
uses: codespell-project/actions-codespell@v2
2 changes: 1 addition & 1 deletion CONTRIBUTION.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Translations

I would be DELIGHTED to recieve translations, in any order, don't feel you have to start from the start! Please give me a PR (based on your forked repo) and use this heirachy: `/scripts/translations/fr/xx-your-translation-here.md`
I would be DELIGHTED to receive translations, in any order, don't feel you have to start from the start! Please give me a PR (based on your forked repo) and use this hierarchy: `/scripts/translations/fr/xx-your-translation-here.md`

Thank you!
8 changes: 4 additions & 4 deletions scripts/01-rust-your-code-can-be-perfect.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,10 @@ We're here to talk about making perfect software.
I'm TIRED of trawling error logs for it to tell me:
- `"unexpected ; in query"`, or
- `json decoding error on line 1`
- `NullPointerException` (or `NoneType has no atribute`)
- `NullPointerException` (or `NoneType has no attribute`)

notes:
I've been searching for many years for systems, frameworks and methods to make my code more reliable, or guarenteed.
I've been searching for many years for systems, frameworks and methods to make my code more reliable, or guaranteed.
We as developers accept that our lives are governed by errors.
Often bullshit errors like these.

Expand Down Expand Up @@ -304,7 +304,7 @@ This may be a new way of programming for you, but it's such a good pattern that
notes:
Rust has a best-in-class package manager, solving all the dependency nightmares we face day-to-day.

This is what you get when you have a community focussed on corectness.
This is what you get when you have a community focussed on correctness.

---

Expand Down Expand Up @@ -404,7 +404,7 @@ Lets reason about this short piece of code.

It's still using the Rocket web framework, by the way, think of it as an Express, Sinatra, or Flask equivalent.

If our program compiles we know many things are guarenteed:
If our program compiles we know many things are guaranteed:
- `id` will be a valid UUID, from a valid http path
- The return json will ALWAYS be in the schema we designed, named FormResponse, with defined values acting as the contract we can never break with our API clients.
- sqlx actually runs that query on my local dev database with a valid test input (generated on the type) in a rolled-back transaction at compile time. If it is invalid, my code doesn't compile.
Expand Down
2 changes: 1 addition & 1 deletion scripts/04-rust-impatient.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ The semi-colon marks the end of a statement.
notes:

The semi-colon marks the end of a statement.
Unlike in other langauges, semicolons are not just mandatory whitespace.
Unlike in other languages, semicolons are not just mandatory whitespace.

---

Expand Down
8 changes: 4 additions & 4 deletions scripts/05-stop-writing-rust.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ Backwards compatibility and correctness.
notes:

In previous videos I said that there will be no Rust 2.0 due to the macro system. Now, I talked with a Rust maintainer, and they said this actually misses the point:
Code written today will be compileable in 5, 10, 40 years because of the Rust team's commitment to perfect backwards compatibility.
Code written today will be compilable in 5, 10, 40 years because of the Rust team's commitment to perfect backwards compatibility.
Code you write today, will always compile in all future versions of rust.
The side effect of this is that code you build today benefits from ALL FUTURE OPTIMISATIONS that the rust toolchain will receive.
With no modification by you, your build times and deployed code will get FASTER.
Expand Down Expand Up @@ -273,7 +273,7 @@ notes:
You can either quickly tell the compiler that you KNOW the result might be a failure, and use .unwrap(), just to get something working now, optionally enriching the crash with an error message with .expect(), or you can handle the error comprehensively.

When writing rust, .unwrap() is for prototyping code, so we don't have the annoyance of heavyweight error handling when we just want to get going.
This is why most code exmaples you will see use .unwrap().
This is why most code examples you will see use .unwrap().
They're not trying to teach you error handling, they're just showing you how to open a file.
In other languages these kinds of runtime pitfalls are hidden, at best by an exception that you have to catch, or worst, with no visible indication that the code may crash at all.

Expand Down Expand Up @@ -346,7 +346,7 @@ I will talk about three.
```

```rust
> "javscript"
> "javascript"
```

```rust
Expand Down Expand Up @@ -451,7 +451,7 @@ It's not just possible to write perfect safe code with Rust. It's actually easy.

---

## WERID ANALOGY TIME
## WEIRD ANALOGY TIME

notes:
Let me finish with a real-life analogy of what it feels like to me to deploy Rust
Expand Down
6 changes: 3 additions & 3 deletions scripts/11-Rust-Makes-Cents.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ async fn main() -> Result<(), Error> {

---

## Lambda Http Hander
## Lambda Http Handler

```toml
lambda_http = "0.6.1"
Expand All @@ -317,7 +317,7 @@ notes:

Here is an http hello world lambda handler in Rust using the official aws sdk, which contains all functions and types for interacting with the aws cloud.

This compiles, the comipler throws up no errors, which means we can be confident about a lot of things without any extra testing.
This compiles, the compiler throws up no errors, which means we can be confident about a lot of things without any extra testing.

---

Expand Down Expand Up @@ -564,7 +564,7 @@ def fib(n: int) -> Iterator[int]:
notes:

In fact the opposite is true.
The larger and more complex your codebase is the more guarantees you want to build-in to your compilers your linter, and your tests.
The larger and more complex your codebase is the more guarantees you want to built-in to your compilers your linter, and your tests.

Everyone loves typescript (almost as much as they love rust) and with good reason. It has some of the syntax that javascript is missing that developers are crying out for.
and the python world is slowly embracing static typing, since type annotations were added in Python 3.
Expand Down
2 changes: 1 addition & 1 deletion scripts/12-webgl-rust-wasm.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ And when we stop thinking about 'web apps' as 'web pages' and start thinking of

notes:

Every week we hear about new, faster javascript frameworks coming out, offering more and more dom manipulations per second. Svelt compared to React, for instance.
Every week we hear about new, faster javascript frameworks coming out, offering more and more dom manipulations per second. Svelte compared to React, for instance.

They're useful for a DOM-constrained app, but we have access to native UI speeds, no latency, and 60fps with webgl.

Expand Down
4 changes: 2 additions & 2 deletions scripts/16-rust-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ For the remainder of the bugs that ARE possible to express, you will indeed need

| Happy Path | Comprehensive | Probabilistic |
| ------------ | ------------- | ------------- |
| Assertations | Black Box | QuickCheck |
| Assertions | Black Box | QuickCheck |
| Doctests | White Box | Proptest |
| Examples | | Fuzzing |

Expand Down Expand Up @@ -497,7 +497,7 @@ def hello(name):
```

notes:
Probabalistic testing is a great way to shine a light into the dusty corners of our app that we may have forgotten about.
Probabilistic testing is a great way to shine a light into the dusty corners of our app that we may have forgotten about.

However, in other languages, it often requires boilerplate code.

Expand Down
2 changes: 1 addition & 1 deletion scripts/17-ai-the-second-renaissance.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ notes:

The first coffeehouses in [Constantinople](https://en.wikipedia.org/wiki/Constantinople "Constantinople") were opened in 1475

While better historians than me will tell you the myriad causes of the European Rennaisance, the factor that I really like is that it happened just after Europeans stopped daydrinking beer as their only safe option.
While better historians than me will tell you the myriad causes of the European Renaissance, the factor that I really like is that it happened just after Europeans stopped daydrinking beer as their only safe option.

---

Expand Down
4 changes: 2 additions & 2 deletions scripts/18-rusts-magic-macros.md
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ Let's look at compile-time execution.

---

# Arbitary Compile-time Execution
# Arbitrary Compile-time Execution

```rust[]
// let mut conn = <impl sqlx::Executor>;
Expand All @@ -506,7 +506,7 @@ Though it has normal functions for querying the database, it also has the query!

At runtime, this is just the same as any other string-based sql querying library.
It sends that string query along to the db through the connection.
But at compiletime, the query!() macro does some magic.
But at compile time, the query!() macro does some magic.

SQLx leverages the power of Rust's macros AND rich type system to fill in the string query with test data and execute it on your local dev database at compile time.

Expand Down
2 changes: 1 addition & 1 deletion scripts/19-av.md
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ I'm editing this audio and video right now in reaper, in addition to being the b

Reaper is not open source, but before that puts you off let me redeem it with two facts:

One, linux is natively supported, alongside the usual suspects of windows and osx, but it feels like the reaper developers REALLY care about linux support, it works on raspberry pi and even on the new M1 mac hardware, runnin on asahi linux.
One, linux is natively supported, alongside the usual suspects of windows and osx, but it feels like the reaper developers REALLY care about linux support, it works on raspberry pi and even on the new M1 mac hardware, running on asahi linux.

The second reason is sentimental. It's built by <https://en.wikipedia.org/wiki/Justin_Frankel,> who made among other things:

Expand Down
6 changes: 3 additions & 3 deletions scripts/20-rust-userland.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ sccache re-uses already-compiled artifices to skip redundant compilation. and in

When you're installing system tools that very often are built by people that always use the stable version of a dependency, you might unnecessarily re-compile that dependency very often.

With sccache, you wont.
With sccache, you won't.

---

Expand Down Expand Up @@ -145,7 +145,7 @@ Nu is a shell built around the language of the same name.

---

## Nu's Structured Pipelins
## Nu's Structured Pipelines

![[nu-post-httpbin.png]]
notes:
Expand Down Expand Up @@ -366,7 +366,7 @@ notes:

> Bob is a cross-platform and easy-to-use Neovim version manager, allowing for switching between versions right from the command line.

I found it after discovering that the ubuntu repos did not have neovim verion 0.8, which is the minimum version that my preferred distribution, astronvim, supports.
I found it after discovering that the ubuntu repos did not have neovim version 0.8, which is the minimum version that my preferred distribution, astronvim, supports.

Though the neovim team build comprehensive packages and installers for every system, I try not to do in a web browser what I can do on the command line.
A theme you will see more of today.
Expand Down
2 changes: 1 addition & 1 deletion scripts/22-starting-rust.md
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ Rust is flexible, and doesn't force you to write in a functional style. Haskell,
notes:

Have a look at either Learn You A Haskell or Real World Haskell or both.
Again, you can mostly read through these quickly. Your package manger will have the haskell repl, which is called GHCI, and any version it installs will be fine for experimentation.
Again, you can mostly read through these quickly. Your package manager will have the haskell repl, which is called GHCI, and any version it installs will be fine for experimentation.

Learning Haskell will teach you about mapping, filtering, folding, currying, matching, and many other words to describe your algorithms in rust, which are abandoned in other languages that just use for loops and if statements.

Expand Down
8 changes: 4 additions & 4 deletions scripts/23-amateur-radio.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ notes:
If you've heard of CB radio, and you're thinking "oh this sounds similar".
You're getting there, but Amateur radio is so much more.

A short list of things you can do with amatuer radio include but are not limited to:
A short list of things you can do with amateur radio include but are not limited to:

---

Expand Down Expand Up @@ -507,7 +507,7 @@ It's a clever idea, and one that Amateur Radio operators were experimenting with

There are repeaters EVERYWHERE, no matter where you live.

In decending order of my youtube audience , here are the repeater maps for -
In descending order of my youtube audience , here are the repeater maps for -

---

Expand Down Expand Up @@ -570,7 +570,7 @@ Wherever there are towns and cities there are repeaters!
If you want access to this world, it's cheap and easy, but like driving a car, there's a test and a license.
And just like driving a car it augments any outdoor activity you might want to do.

I've not even talked about the lower frequencies, where you can get worldwide propogation without using repeaters!
I've not even talked about the lower frequencies, where you can get worldwide propagation without using repeaters!

---

Expand Down Expand Up @@ -619,7 +619,7 @@ notes:
When you talk to someone on radio without a repeater, you are talking directly to them at the speed of light, from your microphone to their speaker, with no intermediaries.
Using the right frequency and antenna, this can be local in your city, or transcontinental, bouncing off the atmosphere or ground.

This direct communication feels much more personal - your voice is being mixed with a radio carrier signal or similar and broadcast in an analogue signal, then the reciever reverses the process to demodulate your voice.
This direct communication feels much more personal - your voice is being mixed with a radio carrier signal or similar and broadcast in an analogue signal, then the receiver reverses the process to demodulate your voice.

It's analogue all the way, no bits, no bytes.

Expand Down
2 changes: 1 addition & 1 deletion scripts/24-rust-data-modelling.md
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ notes:

And here's our little state machine in action!

In other languages, we'd have to do a lot of testing to prove we'd written our arbitary if statements correctly, and not missed a case, or written unreachable cases.
In other languages, we'd have to do a lot of testing to prove we'd written our arbitrary if statements correctly, and not missed a case, or written unreachable cases.
Gross.

There are no edge cases here, I only have to scrutinise the match expression to ensure the business logic is implemented correctly, and when I need to change the states, perhaps in Super Mario 64, it's easy, and the compiler will tell us what match statements need updating.
Expand Down
10 changes: 5 additions & 5 deletions scripts/26-oxidise-your-infra-with-shuttle.md
Original file line number Diff line number Diff line change
Expand Up @@ -359,10 +359,10 @@ notes:

Here's a simple rocket.rs demo of shuttle persist.

The persist struct that is passed in inside our MyState wrapper can load and save ANY serde serialisable struct trasparently.
The persist struct that is passed in inside our MyState wrapper can load and save ANY serde serialisable struct transparently.

Behind the scenes, shuttle have told me that this is implemented with a persistant docker volume attached to your project.
This is a genius simple persistance option for when managing a database is overkill.
Behind the scenes, shuttle have told me that this is implemented with a persistent docker volume attached to your project.
This is a genius simple persistence option for when managing a database is overkill.


---
Expand Down Expand Up @@ -422,7 +422,7 @@ Support and community organising is over on their Discord, where I immediately f
# Shuttle Launchpad

A Rust course written by Stefan Baumgartner
(organiser of [Rust Linz](https://rust-linz.at/))
(organiser of [Rust Lines](https://rust-linz.at/))

https://www.shuttle.rs/launchpad

Expand All @@ -440,7 +440,7 @@ Axum + DB + Static files demo

notes:

A hello world is all very well, but let's build something with persistance showing how to use the shuttle infrastructure from code principles.
A hello world is all very well, but let's build something with persistence showing how to use the shuttle infrastructure from code principles.

---

Expand Down
2 changes: 1 addition & 1 deletion scripts/27-coping-mechanisms.md
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ HOWEVER negative emotions are not ENTIRELY un-useful!
Remember that girl I mentioned earlier? You'll stay with her because you're minimising the negative emotions you're feeling.
That's not good.

You're not a robot, I know, but throuhg practice you can choose what to feel, and what to notice.
You're not a robot, I know, but through practice you can choose what to feel, and what to notice.
Notice the negatives, but feel the positives.

You have to FOCUS.
Expand Down
2 changes: 1 addition & 1 deletion scripts/28-how-to-speak-basic-rust.md
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ The rust compiler doesn't need to treat threaded code as a special case to maint

notes:

Read the erorr again, thank you!
Read the error again, thank you!

---

Expand Down
8 changes: 4 additions & 4 deletions scripts/30-poem.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,11 @@ notes:

So let's talk about what we're NOT going to be doing, with a counter example.
web.py is one of the many gifts the late, great Aaron Swartz gave us.
It's elegant in its simplicity, but we are not building simple tools, today we are building guarenteed correct tools.
It's elegant in its simplicity, but we are not building simple tools, today we are building guaranteed correct tools.

Python, and by virtue, web.py can't give you these guarnetees, lots of things are just strings, and the language can't help you with compile time checking very much.
Python, and by virtue, web.py can't give you these guarantees, lots of things are just strings, and the language can't help you with compile time checking very much.

Luckly we have Rust.
Luckily we have Rust.

---

Expand Down Expand Up @@ -446,7 +446,7 @@ Binding your database and rest interface together AT COMPILE TIME allows us to h

This is a SUPER POWER: if you define your API in rust structs, the COMPILER will stop you from breaking the contract with your api clients.

Not only that, but if you don't see a PR where the structs change, your colleagues and collaborators havn't broken the contract EITHER.
Not only that, but if you don't see a PR where the structs change, your colleagues and collaborators haven't broken the contract EITHER.

Huge!

Expand Down
2 changes: 1 addition & 1 deletion scripts/32-rust-is-written-in-rust.md
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ let my_unit = Unit;
```rust[]
enum Infallible {}

// compile error, no varients = can't instantiate
// compile error, no variants = can't instantiate
let impossible = Infallible::no_varients_found;
```

Expand Down
2 changes: 1 addition & 1 deletion scripts/34-Plain-Text-Team.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ In the Odyssey, Odysseus (confusingly called Ulysses in English literature) had
This was a well-understood problem in his world.
Sailors would simply solve this by putting wax in their ears, so the sirens' tempting song wouldn't lure them to their deaths.

But Odysseus had a challenge: He WANTED to hear the Sirens' beautiful song. He certainly didn't want to drown, so he ordered his crew to tie him to the mast of the ship, and to ignore any of his pleas to let him go, until safety.
But Odysseus had a challenge: He WANTED to hear the Sirens' beautiful song. He certainly didn't want to drown, so he ordered his crew to tie him to the mast of the ship, and to ignore any of his please to let him go, until safety.

This way, he was able to guard against future bad decisions he knew he would make by setting up a framework to control his future self.

Expand Down
2 changes: 1 addition & 1 deletion scripts/37-functional-rust.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ notes:

I ADORE Haskell. In my 'how to learn rust' video, I recommended learning the basics to teach you functional programming quickly.

The language has many incredible features that give me similar confidence to using Formal Methods, and the one I'll hightlight today is functional purity, which is a term you might be familiar with.
The language has many incredible features that give me similar confidence to using Formal Methods, and the one I'll highlight today is functional purity, which is a term you might be familiar with.

In Haskell, and maybe, kinda, Rust, it's a first-class feature.

Expand Down
Loading