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

Break it mdl #968

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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
39 changes: 27 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -431,18 +431,6 @@ jobs:
git config --global --add safe.directory $GITHUB_WORKSPACE
$GITHUB_WORKSPACE/test/scripts/shellcheck

# Test markdown
markdownlint:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2

- name: Run markdownlint
shell: bash
run: |
sudo snap install mdl
$GITHUB_WORKSPACE/test/scripts/markdownlint

# Test YAML
yamllint:
runs-on: ubuntu-20.04
Expand All @@ -454,4 +442,31 @@ jobs:
run: |
sudo apt install yamllint
$GITHUB_WORKSPACE/test/scripts/yamllint

# Lint with pre-commit
lint:
container: johnmcfarlane/cnl_ci:clang-14
runs-on: ubuntu-22.04
steps:
- name: Clone repository
uses: actions/checkout@v3

- name: Load package caches
uses: actions/cache@v2
env:
CACHE_SLUG: ${{ github.job }}-${{ matrix.name }}
with:
path: |
/github/home/.cache/pre-commit
key: ${{ env.CACHE_SLUG }}-${{ github.ref_name }}
restore-keys: |
${{ env.CACHE_SLUG }}-main
${{ env.CACHE_SLUG }}-${{ github.ref_name }}
${{ env.CACHE_SLUG }}-

- name: Run pre-commit
shell: bash
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
$GITHUB_WORKSPACE/test/scripts/lint
...
13 changes: 13 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
exclude: ^(.*).md$

- repo: https://github.com/markdownlint/markdownlint
rev: v0.11.0
hooks:
- id: markdownlint
args: ["--style", "test/scripts/mdl.style"]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,5 +176,5 @@ Examples of projects using CNL:

All feedback greatly appreciated.

* [CNL Issues](https://github.com/johnmcfarlane/cnl/issues)
* [cnl@john.mcfarlane.name](mailto:cnl@john.mcfarlane.name)
- [CNL Issues](https://github.com/johnmcfarlane/cnl/issues)
- [cnl@john.mcfarlane.name](mailto:cnl@john.mcfarlane.name)
6 changes: 3 additions & 3 deletions include/cnl/_impl/ckormanyos/uintwide_t.h
Original file line number Diff line number Diff line change
Expand Up @@ -2522,7 +2522,7 @@
? static_cast<size_t>(std::numeric_limits<local_unknown_builtin_integral_type>::digits + 1)
: static_cast<size_t>(std::numeric_limits<local_unknown_builtin_integral_type>::digits + 0)>::exact_unsigned_type;

static constexpr unsigned_fast_type value =
static constexpr unsigned_fast_type value =
static_cast<unsigned_fast_type>( std::numeric_limits<local_unsigned_conversion_type>::digits
/ std::numeric_limits<limb_type>::digits);

Expand Down Expand Up @@ -5574,7 +5574,7 @@
static_assert((digits_generator_result_type % UINT32_C(8)) == UINT32_C(0),
"Error: Generator result type must have a multiple of 8 bits.");

constexpr auto digits_limb_ratio =
constexpr auto digits_limb_ratio =
static_cast<std::uint32_t>(std::numeric_limits<local_limb_type>::digits / 8U);

constexpr auto digits_gtor_ratio = static_cast<std::uint32_t>(digits_generator_result_type / 8U);
Expand Down Expand Up @@ -5701,7 +5701,7 @@
// See also:
// https://www.wolframalpha.com/input/?i=Table%5BPrime%5Bi%5D%2C+%7Bi%2C+2%2C+49%7D%5D

constexpr std::array<local_limb_type, 48U> small_primes =
constexpr std::array<local_limb_type, 48U> small_primes =
{{
UINT8_C( 3), UINT8_C( 5), UINT8_C( 7), UINT8_C( 11), UINT8_C( 13), UINT8_C( 17), UINT8_C( 19), UINT8_C( 23),
UINT8_C( 29), UINT8_C( 31), UINT8_C( 37), UINT8_C( 41), UINT8_C( 43), UINT8_C( 47), UINT8_C( 53), UINT8_C( 59),
Expand Down
11 changes: 11 additions & 0 deletions test/scripts/lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

set -euo pipefail

PROJECT_DIR=$(
cd "$(dirname "$0")"/../..
pwd
)
cd "${PROJECT_DIR}"

pre-commit run --all-files --show-diff-on-failure
20 changes: 0 additions & 20 deletions test/scripts/markdownlint

This file was deleted.