Commit Graph

21 Commits

Author SHA1 Message Date
Matt Godbolt
ddb0266645 Convert propscheck.py to TypeScript/Vitest tests (#8404)
## Summary

Replaces the Python `propscheck.py` validation script with TypeScript
code that:
- Uses a testable validator module (`lib/properties-validator.ts`)
- Has comprehensive unit tests (71 tests in
`test/properties-validation-tests.ts`)
- Integrates with the existing property loading infrastructure
- Runs as part of the normal test suite

## Changes

- **New validator module** (`lib/properties-validator.ts`):
- Raw file validation: duplicate keys, empty list elements, typos,
suspicious paths
  - Orphan detection: compilers, groups, formatters, tools, libraries
  - Cross-file duplicate compiler ID detection
  - Disabled allowlist support (`# Disabled: id1 id2`)
- Invalid property format detection (leverages `parseProperties()` with
new `collectErrors` option)
  - Missing compilers list detection for language files

- **Property library enhancement** (`lib/properties.ts`):
- Added `collectErrors` option to `parseProperties()` for structured
error collection

- **New npm script**: `npm run test:props` for quick property validation
  - Set `CHECK_LOCAL_PROPS=true` to include `.local.properties` files

- **Updated references**:
  - CI workflow no longer calls propscheck.py
  - Pre-commit hook uses `npm run test:props`
  - CE Properties Wizard uses the new validation

- **Removed**: `etc/scripts/util/propscheck.py` and `propschecktest.py`

## Test plan

- [x] All 71 unit tests pass
- [x] Integration tests validate real config files
- [x] `npm run test:props` works standalone
- [x] CE Properties Wizard validation works
- [x] CI passes

🤖 Generated with [Claude Code](https://claude.ai/code)

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 19:03:00 -05:00
Patrick Quist
16af4186ad CE Properties Wizard: Interactive tool for adding compilers (#7934) 2025-10-04 12:11:58 +02:00
Partouf
1f7099057c additional propcheck 2025-09-13 21:29:39 +02:00
Rupert Tombs
5eeded45c4 Test the numba wrapper in test-and-deploy (#7413)
- Resolve comments from #5592:
- Replace a silly indirect import
https://github.com/compiler-explorer/compiler-explorer/pull/5592#discussion_r1962004963
- Run `test_numba_wrapper` in `.github/workflows/test-and-deploy.yml`.
https://github.com/compiler-explorer/compiler-explorer/pull/5592#discussion_r1962004131
- Patch minor errors in `etc/scripts/util/propschecktest.py` and also
test it.
2025-02-24 09:58:31 -06:00
Marc Poulhiès
4f6106da3f propcheck: skip local properties (#5254)
fixes #5251

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
2023-07-11 14:06:25 +02:00
Marc Poulhiès
c581148fd3 propcheck: applies to local config (#5250)
Applies to local config and fix existing issues.

By defaults, local and defaults are not checked for suspicious path (exe
not starting with /opt/compiler-explorer). This can be forced with the
--check-suspicious-in-local-prop.

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
2023-07-10 08:19:57 +02:00
Marc Poulhiès
64ceb0ca03 Add missing test case for recent new propcheck rule
The test was missing, adding it now... /o\
refs #5009

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
2023-05-08 20:39:19 +02:00
Marc Poulhiès
016fe2d04b propcheck: catch one more small error (#5009)
Catch invalid lines (i.e. not a comment and not a prop).
Also refine the PROP_RE so that the 'key' can't have a space (this could
be made more correct by allowing space around '=', but we don't have
any, so....)

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
2023-04-29 23:49:53 +02:00
Patrick Quist
7d192ccde1 add properties and test for cewrapper (#4761) 2023-03-18 11:46:27 +01:00
谭九鼎
02060bddfe update some py scripts (#4533) 2023-01-09 07:34:03 -06:00
partouf
303d10a879 fix propscheck for empty properties files 2022-11-04 21:10:27 +01:00
Rubén Rincón Blanco
5bacce7c76 Add better duplicated key check & fix those issues (#4090) 2022-09-24 20:55:24 +02:00
Rubén Rincón Blanco
cb39844d7f Ensure there are no duplicated compiler ids between hierarchies (#4003)
* Checks now always output which line is failing

* Ensure no duplicated compilerids between hierarchies
2022-08-29 17:08:42 -05:00
Rubén Rincón Blanco
4a9557e94e Add some more checks & rename for consistency (#3999)
* Add compiler check for every prop & typo check

* Renames tests cases for consistency & adds a few checks
2022-08-29 10:39:42 -05:00
Marc Poulhiès
ded668b5d2 propcheck: check for suspicious paths (#3972)
Checks that paths in .amazon.properties are starting with

/opt/compiler-explorer/.

Also rename cppx_blue default config file (was .default. instead of .defaults.).

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
2022-08-19 19:51:27 +02:00
Marc Poulhiès
ca6153c86e propcheck: better check duplicated compilers/groups (#3967)
Check for duplicated compiler or group references:

group.cmipsel.compilers=cmips5el:cmipselg1210:cmips64elg1210
group.cmips64el.compilers=cmips564el:cmips64elg1210

triggers:
duplicated_compiler_references:
        cmips64elg1210

group.cmipss.compilers=&cmips:&cmipsel:&cmips64:&cmips64el
group.ccross.compilers=&cppcs:&cmipss:&cmips64el:&cnanomips:&cmrisc32:&cmsp:&cgccarm:&cavr:&rvcgcc:&cxtensaesp32:&cxtensaesp32s2:&cxtensaesp32s3:&cplatspec:&ckalray:&cs390x

triggers:
duplicated_group_references:
        cmips64el

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
2022-08-19 19:21:18 +02:00
Rubén Rincón Blanco
16b176235a JBOF: Just a Bunch of Fixes (#3957)
- Renames orphancompiler.py script to propscheck.py, the name fits better
- Fixes Go props to make them easier to maintain
- Alphabetically sorts some listings in the code
- Adds tests to the props checker script (No idea how to integrate those so it's manual for now)
- Adds 2 missing limit cases for Motd filtering
2022-08-13 01:39:41 +02:00
Rubén Rincón Blanco
38cf38fcbf Sprinkle some path.delimiter around (#3725) 2022-05-27 22:52:48 +02:00
Matt Godbolt
7828576a5b Reverts the reversion of the "make" being more prod-like, and fixes it. (#3591)
* Use webpack to autogenerate the files.

That way, we always generate them consistently, be it through
`make` or building for prod. This fixes the `make` issue, and also
means we've further unified the way we build and run with `make`
vs prod.

Unfortunately this doesn't work for `make dev`; which sees the
handlebars content only. That's probably ok though, I think.
2022-04-28 12:59:25 -05:00
Matt Godbolt
5ae6b304e4 Pre-compile typescript in releases (#3570)
* build the release in-place in out/dist
* run the tsc compiler on the code so everything is pre-transpiled
* serve the various generated html snippets uniformly from the web page so they come from one place.
2022-04-27 16:24:50 -05:00
Rubén Rincón Blanco
48eee26d2c Group some files to their own folders (#3384)
* Group some files to their own folders

In etc/scripts/, added disasms/, docenizers/, and util/ folders
In lib/, added mapfiles/, and parsers/ folders (+moved google.js to
shortener)
In static/, added widgets/ folder

Added cypress folder to .gitignore

* Address Matt's PR reviews

* Move new Pane renaming to folder
2022-02-22 00:18:21 +01:00