Skip to content
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
33 changes: 33 additions & 0 deletions .github/workflows/check-python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: check-python

on:
pull_request:
paths:
- "tools/**.py"
- "pyrightconfig.json"
- ".github/workflows/check-python.yml"
push:
paths:
- "tools/**.py"
- "pyrightconfig.json"
- ".github/workflows/check-python.yml"

jobs:
pyright:
name: Pyright type check
runs-on: ubuntu-24.04

steps:
- name: checkout
uses: actions/checkout@v6

- name: setup Node
uses: actions/setup-node@v6
with:
node-version: "20"

- name: install pyright
run: npm install -g pyright
Comment on lines +24 to +30

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure pyright is a good call. There are other alternatives that do not require pulling in node as dependency.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just use it because it integrates nicely with VSCode out of the box. What would you recommend instead?


- name: run pyright
run: pyright
3 changes: 3 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ jobs:
- name: check-source.sh
run: ../tools/check-source.sh

- name: check-source.py
run: python3 ../tools/check-source.py

- name: update brew
if: matrix.cfg.os == 'macos-15'
run: brew update
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ tools/sections
*.synctex.gz
*.synctex*
.check.stamp
__pycache__

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While it won't matter until we have multiple Python modules, you might want to also ignore *.pyc, *.egg and *.egg-info.

14 changes: 14 additions & 0 deletions pyrightconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"include": [
"tools/*.py"
],
"typeCheckingMode": "strict",
"reportMissingTypeStubs": false,
"reportUnknownMemberType": false,
"reportUnknownArgumentType": false,
"reportUnknownVariableType": false,
"reportUnknownParameterType": false,
"reportUnusedImport": true,
"reportUnusedVariable": true,
"pythonVersion": "3.11"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why 3.11 specifically? That version of Python is EoL in about a year.

For the CI we use Ubuntu 24.04. This ships with Python 3.12 - the current Python release is 3.14

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just blindly copied and pasted this from another project, so no particular reason.

}
1 change: 1 addition & 0 deletions source/algorithms.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%!TEX root = std.tex
%NOCHECKBEGIN(lib-ranges-*)
\rSec0[algorithms]{Algorithms library}

\rSec1[algorithms.general]{General}
Expand Down
1 change: 1 addition & 0 deletions source/assets/example_01.tex
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
%NOCHECKBEGIN
\documentclass[9pt]{standalone}

\usepackage{fontspec}
Expand Down
1 change: 1 addition & 0 deletions source/assets/example_02.tex
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
%NOCHECKBEGIN
\documentclass[9pt]{standalone}

\usepackage{fontspec}
Expand Down
1 change: 1 addition & 0 deletions source/assets/example_03.tex
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
%NOCHECKBEGIN
\documentclass[9pt]{standalone}

\usepackage{fontspec}
Expand Down
1 change: 1 addition & 0 deletions source/assets/example_04.tex
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
%NOCHECKBEGIN
\documentclass[9pt]{standalone}

\usepackage{fontspec}
Expand Down
1 change: 1 addition & 0 deletions source/assets/example_05.tex
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
%NOCHECKBEGIN
\documentclass[9pt]{standalone}

\usepackage{fontspec}
Expand Down
1 change: 1 addition & 0 deletions source/assets/example_06.tex
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
%NOCHECKBEGIN
\documentclass[9pt]{standalone}

\usepackage{fontspec}
Expand Down
1 change: 1 addition & 0 deletions source/basic.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%!TEX root = std.tex
%NOCHECKBEGIN(lib-*)
\rSec0[basic]{Basics}

\gramSec[gram.basic]{Basics}
Expand Down
1 change: 1 addition & 0 deletions source/classes.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%!TEX root = std.tex
%NOCHECKBEGIN(lib-*)
\rSec0[class]{Classes}%
\indextext{class|(}

Expand Down
1 change: 1 addition & 0 deletions source/compatibility.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%!TEX root = std.tex
%NOCHECKBEGIN(lib-*)
\infannex{diff}{Compatibility}

\rSec1[diff.cpp23]{\Cpp{} and ISO \CppXXIII{}}
Expand Down
1 change: 1 addition & 0 deletions source/concepts.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%!TEX root = std.tex
%NOCHECKBEGIN(lib-ranges-*)
\rSec0[concepts]{Concepts library}

\rSec1[concepts.general]{General}
Expand Down
1 change: 1 addition & 0 deletions source/containers.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%!TEX root = std.tex
%NOCHECKBEGIN(lib-ranges-*)
\rSec0[containers]{Containers library}

\rSec1[containers.general]{General}
Expand Down
1 change: 1 addition & 0 deletions source/declarations.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%!TEX root = std.tex
%NOCHECKBEGIN(lib-*)
\rSec0[dcl]{Declarations}%
\indextext{declaration|(}

Expand Down
1 change: 1 addition & 0 deletions source/diagnostics.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%!TEX root = std.tex
%NOCHECKBEGIN(lib-ranges-*)
\rSec0[diagnostics]{Diagnostics library}

\rSec1[diagnostics.general]{General}
Expand Down
1 change: 1 addition & 0 deletions source/exceptions.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%!TEX root = std.tex
%NOCHECKBEGIN(lib-*)
\rSec0[except]{Exception handling}%
\indextext{exception handling|(}

Expand Down
1 change: 1 addition & 0 deletions source/exec.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%!TEX root = std.tex
%NOCHECKBEGIN(lib-ranges-*)
\rSec0[exec]{Execution control library}

\rSec1[exec.general]{General}
Expand Down
1 change: 1 addition & 0 deletions source/expressions.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%!TEX root = std.tex
%NOCHECKBEGIN(lib-*)
\rSec0[expr]{Expressions}

\gramSec[gram.expr]{Expressions}
Expand Down
1 change: 1 addition & 0 deletions source/future.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%!TEX root = std.tex
%NOCHECKBEGIN(lib-*)
\normannex{depr}{Compatibility features}

\rSec1[depr.general]{General}
Expand Down
1 change: 1 addition & 0 deletions source/grammar.tex
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
%NOCHECKBEGIN(lib-*)
\infannex{gram}{Grammar summary}

\rSec1[gram.general]{General}
Expand Down
4 changes: 2 additions & 2 deletions source/intro.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%!TEX root = std.tex
%NOCHECKBEGIN(lib-*)

\clearpage
\bigskip\noindent\textlarger{\textbf{Programming languages --- \Cpp{}}}
Expand Down Expand Up @@ -325,8 +326,7 @@
behavior, for a \termref{defns.well.formed}{well-formed program}{} construct and correct data, that
depends on the implementation and that each implementation documents

\definition{implementation-defined strict total order over pointers}
{defns.order.ptr}
\definition{implementation-defined strict total order over pointers}{defns.order.ptr}
\indexdefn{pointer!strict total order}%
\defncontext{library}
\impldef{strict total order over pointer values}
Expand Down
1 change: 1 addition & 0 deletions source/iostreams.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%!TEX root = std.tex
%NOCHECKBEGIN(lib-ranges-*)
\rSec0[input.output]{Input/output library}

\rSec1[input.output.general]{General}
Expand Down
1 change: 1 addition & 0 deletions source/iterators.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%!TEX root = std.tex
%NOCHECKBEGIN(lib-ranges-*)
\rSec0[iterators]{Iterators library}

\rSec1[iterators.general]{General}
Expand Down
1 change: 1 addition & 0 deletions source/layout.tex
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
% Register our intent to number the next paragraph. Don't actually number it
% yet, because we might have a paragraph break before we see its contents (for
% example, if the paragraph begins with a note or example).
%EXPECTCHECKNEXTLINE(base-pnum-alone)
\def\pnum{%
\global\def\maybeaddpnum{\global\def\maybeaddpnum{}\parabullnum{Paras}{0pt}}%
\everypar=\expandafter{\the\everypar\maybeaddpnum}%
Expand Down
1 change: 1 addition & 0 deletions source/lex.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%!TEX root = std.tex
%NOCHECKBEGIN(lib-*)
\rSec0[lex]{Lexical conventions}

\gramSec[gram.lex]{Lexical conventions}
Expand Down
1 change: 1 addition & 0 deletions source/limits.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%!TEX root = std.tex
%NOCHECKBEGIN(lib-*)
\infannex{implimits}{Implementation quantities}

\pnum
Expand Down
2 changes: 2 additions & 0 deletions source/macros.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
%!TEX root = std.tex
%NOCHECKBEGIN
%NOCHECKEND(text-*)

% Definitions and redefinitions of special commands
%
Expand Down
1 change: 1 addition & 0 deletions source/memory.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%!TEX root = std.tex
%NOCHECKBEGIN(lib-ranges-*)
\rSec0[mem]{Memory management library}

\rSec1[mem.general]{General}
Expand Down
1 change: 1 addition & 0 deletions source/meta.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%!TEX root = std.tex
%NOCHECKBEGIN(lib-ranges-*)
\rSec0[meta]{Metaprogramming library}

\rSec1[meta.general]{General}
Expand Down
1 change: 1 addition & 0 deletions source/modules.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%!TEX root = std.tex
%NOCHECKBEGIN(lib-*)
\rSec0[module]{Modules}%

\gramSec[gram.module]{Modules}
Expand Down
6 changes: 5 additions & 1 deletion source/numerics.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%!TEX root = std.tex
%NOCHECKBEGIN(lib-ranges-*)
\rSec0[numerics]{Numerics library}

\rSec1[numerics.general]{General}
Expand Down Expand Up @@ -17724,6 +17725,7 @@

\pnum
\constraints
%NOCHECKBEGIN(base-tcode-exposid)
Every type in the parameter pack \tcode{Flags} is one of \tcode{\exposid{convert-flag}},
\tcode{\exposid{aligned-flag}}, or \tcode{\exposid{over\-aligned-\brk{}flag}<N>}.
Comment on lines +17728 to 17730

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can just remove the \tcode wrapping around \exposid here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, we could. It would be something like 10 separate fixes.

I think I'll just do a surgical fix in a separate PR for these cleanups so that this PR doesn't have to clean up any existing sources.

The problem with the existing check is that the regex pattern doesn't work on hyphenated identifiers.


Expand Down Expand Up @@ -19889,6 +19891,7 @@
where \tcode{\exposid{simd-select-impl}} is found by argument-dependent
lookup\iref{basic.lookup.argdep} contrary to \ref{contents}.
\end{itemdescr}
%NOCHECKEND(base-tcode-exposid)

\rSec3[simd.math]{Mathematical functions}

Expand Down Expand Up @@ -20946,7 +20949,8 @@
\tcode{basic_mask<Bytes, Abi>} is trivially copyable.

\pnum
\recommended Implementations should support implicit conversions between
\recommended
Implementations should support implicit conversions between

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move all specific fixes to a separate commit.

specializations of \tcode{basic_mask} and appropriate \impldef{conversions
of \tcode{basic_mask} from/to implementation-specific vector types} types.
\begin{note}
Expand Down
5 changes: 3 additions & 2 deletions source/overloading.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%!TEX root = std.tex
%NOCHECKBEGIN(lib-*)
\rSec0[over]{Overloading}%
\indextext{overloading|(}

Expand Down Expand Up @@ -3845,11 +3846,11 @@
In this subclause, the term
\defn{promoted integral type}
is used to refer to those cv-unqualified integral types which are preserved by
integral promotion\iref{conv.prom} (including e.g.
integral promotion\iref{conv.prom} (including e.g.,
\tcode{int}
and
\tcode{long}
but excluding e.g.
but excluding e.g.,
\tcode{char}).
\begin{note}
In all cases where a promoted integral type is
Expand Down
1 change: 1 addition & 0 deletions source/preprocessor.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%!TEX root = std.tex
%NOCHECKBEGIN(lib-*)
\rSec0[cpp]{Preprocessing directives}%
\indextext{preprocessing directive|(}

Expand Down
1 change: 1 addition & 0 deletions source/statements.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%!TEX root = std.tex
%NOCHECKBEGIN(lib-*)
\rSec0[stmt]{Statements}%
\indextext{statement|(}

Expand Down
1 change: 1 addition & 0 deletions source/strings.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%!TEX root = std.tex
%NOCHECKBEGIN(lib-ranges-*)
\rSec0[strings]{Strings library}

\rSec1[strings.general]{General}
Expand Down
1 change: 1 addition & 0 deletions source/tables.tex
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
%!TEX root = std.tex
% Definitions of table environments
%NOCHECKBEGIN(base-env-balancing)

%%--------------------------------------------------
%% Table environments
Expand Down
1 change: 1 addition & 0 deletions source/templates.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%!TEX root = std.tex
%NOCHECKBEGIN(lib-*)
\rSec0[temp]{Templates}%
\indextext{template|(}

Expand Down
1 change: 1 addition & 0 deletions source/text.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%!TEX root = std.tex
%NOCHECKBEGIN(lib-ranges-*)

\rSec0[text]{Text processing library}

Expand Down
1 change: 1 addition & 0 deletions source/threads.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%!TEX root = std.tex
%NOCHECKBEGIN(lib-ranges-*)
\rSec0[thread]{Concurrency support library}

\rSec1[thread.general]{General}
Expand Down
1 change: 1 addition & 0 deletions source/time.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%!TEX root = std.tex
%NOCHECKBEGIN(lib-ranges-*)
\rSec0[time]{Time library}

\rSec1[time.general]{General}
Expand Down
1 change: 1 addition & 0 deletions source/uax31.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%!TEX root = std.tex
%NOCHECKBEGIN(lib-*)
\infannex{uaxid}{Conformance with \UAX{31}}

\rSec1[uaxid.general]{General}
Expand Down
1 change: 1 addition & 0 deletions source/utilities.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%!TEX root = std.tex
%NOCHECKBEGIN(lib-ranges-*)

\rSec0[utilities]{General utilities library}

Expand Down
Loading
Loading