Fifthtry

Pre-Commit Hooks

One of the things that our setup function from auto.sh did was to setup pre-commit hooks.

We are using pre-commit tool for setting up pre-commit hooks. It expects us to have a .pre-commit-hooks.yaml file, here is the one in fifthtry project:

-   repo: https://github.com/ambv/black
    rev: stable
    hooks:
    - id: black
      language_version: python

-   repo: local
    hooks:
    -   id: rustfmt
        name: Rust format
        entry: cargo
        language: system
        args:
        - fmt
        - --
        files: \.rs$
    -   id: elm-format
        name: Elm format
        entry: elm-format
        language: system
        args:
        - --validate
        -  --elm-version=0.19
        - fifthtry/frontend
        - --
        files: \.elm$
        pass_filenames: false
    -   id: clippy
        name: Clippy
        entry: sh scripts/clippy.sh
        language: system
        files: \.rs$
        pass_filenames: false
    -   id: django_check
        name: Django project checks
        entry: sh scripts/django-check.sh
        language: system
        files: (requirements\.txt|\.py)$
        exclude: (scripts/.*\.py|tests/.*)$
        pass_filenames: false

-   repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v2.2.3
    hooks:
    - id: check-added-large-files
      language_version: python
      args:
      - --maxkb=500
    - id: trailing-whitespace
      language_version: python
      args: [--markdown-linebreak-ext=md]
    - id: check-merge-conflict
      language_version: python
    - id: flake8
      language_version: python
      args:
      - --max-line-length=88
      - --ignore=E203,W503
      exclude: (.*/migrations/.*\.py)$
    - id: flake8
      language_version: python
      name: Flake8 migrations
      args:
      - --ignore=E501,W503
      - --max-line-length=88
      files: (.*/migrations/.*\.py)$
    - id: check-case-conflict
      language_version: python
    - id: check-symlinks
      language_version: python
    - id: end-of-file-fixer
      language_version: python

Its recommended you use most of these as starting point, and then tweak as per your needs.

There are two scripts that help in process, scripts/clippy.sh and scripts/django-check.sh, here are they for your reference.

scripts/clippy.sh:

#!/usr/bin/env bash

set -e
cargo-clippy --all --tests -- -Dwarnings
cargo test --all

Nothing fancy.

scripts/django-check.sh:

#!/usr/bin/env bash

set -e
cd dj
../venv/bin/python manage.py check
../venv/bin/python manage.py makemigrations --check --dry-run

Table Of Content

What is Realm?

A Bit On Motivation

Routing is Hard

What does Realm do?

Backend Data And Type Safety

Tutorial

Quick Start Realm Tutorial

In Depth Tutorial (not ready)

Nix
Shell
Doit
Hello Rust
Hello Elm
Hello Static Files
Hello Server Side Rendering
Pre-Commit Hooks

Routing, Request And Response

Frontend, Data, Navigation, And APIs

How To Guides

File Upload

Backend: S3 File Upload
Authenticated File Serving
Frontend: Uploading Files From Elm

How to use storybook?

How to implement “loading..”?

Docs

Realm.In

Realm.Storybook.Story

realm::In

realm::Context

realm::Result

realm.magicSlice

realm::RequestConfig

Environment Variables

Internals - Only for Realm Developers, not Users

“Realm DATA”
iFrame Controller
Shutdown Routine
Testing Internals

Change Log

Get Realm Starter Working

Transparent Offline Feature

How to make http requests in Realm?

Development

Replay Testing

Tutorial: ToDo App

Realm Testing

Enhance Realm Starter

Double Load Issue

Deploy To Heroku Button

End failure

Realm-Starter Github Template

Proposal: Tracker And Visit

Proposal: Activity Store

Proposal: Bundling

Proposal: Retry On Network Error

Storybook: Editable JSON

Storybook: Notes

Storybook: Reference

Backlog

Readings

Change Log

How to Publish

Testing

Code Snippets

Skip rustfmt For Some Section

Close Modal Dialog When Clicked Outside

Ignoring Lints In Python

Ignoring Lints (clippy and rustc warnings) In Rust

Handle DateTime in Rust & Elm

Handle CiText value read in Rust

Transport Enum Type to and fro Rust/Elm through JSON