Skip to content

Commit 7462205

Browse files
committed
Merge branch 'main' of github.com:RaspberryPiFoundation/python-friendly-errors
2 parents d8c7476 + ea3a916 commit 7462205

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

README.md

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
1-
# Python friendly error messages
1+
# Python Friendly Error Messages
22

33
- [ ] Ensure all strings in `src/` are localised
44
- [ ] Consider renaming `explain()` to something like `friendlyExplain()`?
5+
- [ ] Figure out where the built packages should live / be served from
6+
- [ ] Open source?
57

68
A small, runtime-agnostic, library that explains Python error messages in a friendlier way, inspired by [p5.js's Friendly Error System](https://p5js.org/contribute/friendly_error_system/).
79

810
It can be used in browser-based editors (like RPF's [Code Editor web component](https://github.com/RaspberryPiFoundation/editor-ui)) or any environment that executes Python code through Skulpt or Pyodide.
911

1012
## Features
1113

12-
- Parses and normalizes errors from Skulpt or Pyodide (via adapters)
14+
- Parses and normalises errors from Skulpt or Pyodide (via adapters)
1315
- Matches errors against a copydeck (JSON rules and templates)
1416
- Copydeck-based explanations can be localised
15-
- Returns structured explanations or ready-made HTML snippets
16-
- Designed for both integration into browser editors and standalone tools
17+
- Returns structured explanations as well as ready-made HTML snippets
1718

1819
## Usage
1920

@@ -91,13 +92,7 @@ Create a clean build for distribution:
9192
npm run build:all && npm run build:browser
9293
```
9394

94-
Output files will be in dist/:
95-
```
96-
dist/
97-
├─ index.js
98-
├─ index.d.ts
99-
└─ adapters/...
100-
```
95+
Output files will be in `dist/`.
10196

10297
You can now import it elsewhere (see Usage notes):
10398

src/engine.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export const explain = (opts: ExplainOptions): ExplainResult => {
139139
};
140140
}
141141

142-
// Optional verbosity shaping (kept small)
142+
// not convinced by this implementation, and may decide to drop the verbosity option...
143143
if (verbosity === "brief") {
144144
chosen.why = undefined;
145145
chosen.steps = chosen.steps?.slice(0, 1);

0 commit comments

Comments
 (0)