Skip to content

Commit 344e158

Browse files
chore: Add formatting step in pyright-scip & update CI pipeline (#185)
* chore: Add linting and formatting commands to pyright-scip * chore: Add AGENT.md for pyright-scip development instructions * chore: Format pyright-scip with prettier * chore: Add .git-blame-ignore-revs to ignore formatting commit * chore: Add CI workflow for pyright-scip linting and formatting checks * chore: Disable eslint checking -- too many issues * chore: Run formatting & test checks on all PRs & commits * chore: Replace asdf->mise
1 parent f519201 commit 344e158

24 files changed

+17908
-17806
lines changed

.git-blame-ignore-revs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Format pyright-scip with prettier
2+
47615dfee4d2beea57b3ba61f97c1f14d035c9f5

.github/workflows/scip-docker.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,10 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/checkout@v3
17-
- name: Install asdf.
18-
uses: asdf-vm/actions/[email protected]
19-
- name: Cache asdf and asdf-managed tools.
20-
uses: actions/cache@v4
21-
id: asdf-cache
17+
- name: Install mise
18+
2219
with:
23-
path: ${{ env.ASDF_DIR }}
24-
key: asdf-${{ runner.os}}-${{ hashFiles('**/.tool-versions') }}
25-
- name: Install asdf tools (if not cached).
26-
if: steps.asdf-cache.outputs.cache-hit != 'true'
27-
uses: asdf-vm/actions/[email protected]
20+
version: 2025.8.10
2821
- name: Get npm cache directory
2922
id: npm-cache
3023
run: echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT

.github/workflows/scip-snapshot.yml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,24 @@
1-
name: scip-snapshots
1+
name: test
22

33
on:
44
push:
55
branches:
6+
- main
67
- scip
78
pull_request:
8-
branches:
9-
- scip
109

1110
jobs:
12-
build:
11+
check:
1312
strategy:
1413
matrix:
1514
os: [ubuntu-latest, macos-latest]
1615
runs-on: ${{ matrix.os }}
1716
steps:
1817
- uses: actions/checkout@v3
19-
- name: Install asdf.
20-
uses: asdf-vm/actions/[email protected]
21-
- name: Cache asdf and asdf-managed tools.
22-
uses: actions/cache@v4
23-
id: asdf-cache
18+
- name: Install mise
19+
2420
with:
25-
path: ${{ env.ASDF_DIR }}
26-
key: asdf-${{ runner.os}}-${{ hashFiles('**/.tool-versions') }}
27-
- name: Install asdf tools (if not cached).
28-
if: steps.asdf-cache.outputs.cache-hit != 'true'
29-
uses: asdf-vm/actions/[email protected]
21+
version: 2025.8.10
3022
- name: Get npm cache directory
3123
id: npm-cache
3224
run: echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT

.github/workflows/scip-style.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: 'formatting'
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- scip
8+
pull_request:
9+
10+
jobs:
11+
check:
12+
runs-on: ubuntu-latest
13+
name: check
14+
15+
steps:
16+
- uses: actions/checkout@v3
17+
18+
- uses: jdx/[email protected]
19+
with:
20+
version: 2025.8.10
21+
22+
- run: npm install
23+
24+
- run: npm install
25+
working-directory: packages/pyright-scip
26+
27+
- name: Check prettier formatting
28+
run: npm run check:prettier
29+
working-directory: packages/pyright-scip

packages/pyright-scip/.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ module.exports = {
99
},
1010
ignorePatterns: ['temp', 'lsif.ts', 'snapshots'],
1111
rules: {},
12+
root: true,
1213
};
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*.md
2+
*.markdown
3+
dist/
4+
node_modules/
5+
snapshots/

packages/pyright-scip/AGENT.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Agent Instructions for pyright-scip
2+
3+
## Development Commands
4+
5+
### Testing
6+
7+
- `npm test` - Run Jest tests
8+
- `npm run check-snapshots` - Check snapshot tests
9+
- `npm run update-snapshots` - Update snapshot tests
10+
11+
### Building
12+
13+
- `npm run webpack` - Development build
14+
- `npm run build` - Production build
15+
- `npm run watch` - Development build with watch mode
16+
17+
### Formatting
18+
19+
- `npm run fix:prettier` - Fix prettier formatting issues
20+
- `npm run check:prettier` - Check prettier formatting
21+
22+
## Code Style
23+
24+
- Follow existing TypeScript patterns in the codebase
25+
- Use the Sourcegraph ESLint config and Prettier config
26+
- When modifying pyright-internal code, keep changes minimal and add `NOTE(scip-python):` prefix to comments

packages/pyright-scip/CONTRIBUTING.md

Lines changed: 38 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,41 @@
11
# Contributing to scip-python
22

3-
- [Development](#development)
4-
- [Installing dependencies](#installing-dependencies)
5-
- [Building the code](#building-the-code)
6-
- [Running tests](#running-tests)
7-
- [Publishing releases](#publishing-releases)
3+
- [Development](#development)
4+
- [Installing dependencies](#installing-dependencies)
5+
- [Building the code](#building-the-code)
6+
- [Running tests](#running-tests)
7+
- [Formatting](#formatting)
8+
- [Publishing releases](#publishing-releases)
89

910
## Development
1011

1112
### Installing dependencies
1213

13-
1. Install [ASDF](https://asdf-vm.com/guide/getting-started.html).
14+
1. Install [mise](https://mise.jdx.dev/getting-started.html).
1415
2. Install the correct versions of Node and Python:
16+
1517
```bash
16-
asdf plugin add nodejs
17-
asdf plugin add python
18+
mise plugin install nodejs
19+
mise plugin install python
1820
# Install appropriate Node and Python versions based on .tool-versions
19-
asdf install
20-
````
21-
You may need to restart your shell for the changes to take effect.
22-
23-
NOTE: On Linux, ASDF may try to install Python from source instead of
24-
using prebuilt binaries. In that case, you need to install a bunch of
25-
other dependencies first:
26-
```bash
27-
sudo apt update
28-
sudo apt install -y build-essential zlib1g-dev libssl-dev libbz2-dev libsqlite3-dev libncurses-dev libffi-dev readline-common libreadline-dev liblzma-dev
29-
```
21+
mise install
22+
```
23+
24+
You may need to restart your shell for the changes to take effect.
25+
3026
3. Install dependencies:
31-
```bash
32-
# From the root of the repo
33-
npm install
34-
cd packages/pyright-scip
35-
npm install
36-
```
27+
```bash
28+
# From the root of the repo
29+
npm install
30+
cd packages/pyright-scip
31+
npm install
32+
```
3733

3834
All the other commands should be run from the `packages/pyright-scip`
3935
subdirectory.
4036

4137
### Building the code
4238

43-
4439
```bash
4540
# Build in development mode once
4641
npm run webpack
@@ -76,6 +71,7 @@ npm run check-snapshots
7671
#### Filter specific snapshot tests
7772

7873
Use the `--filter-tests` flag to run only specific snapshot tests:
74+
7975
```bash
8076
# Using npm scripts (note the -- to pass arguments)
8177
npm run check-snapshots -- --filter-tests test1,test2,test3
@@ -86,6 +82,22 @@ Available snapshot tests can be found in `snapshots/input/`.
8682
Using a different Python version other than the one specified
8783
in `.tool-versions` may also lead to errors.
8884

85+
### Formatting
86+
87+
To check for formatting issues:
88+
89+
```bash
90+
# Check prettier formatting
91+
npm run check:prettier
92+
```
93+
94+
To fix formatting issues:
95+
96+
```bash
97+
# Fix prettier formatting issues
98+
npm run fix:prettier
99+
```
100+
89101
## Making changes to Pyright internals
90102

91103
When modifying code in the `pyright-internal` package:

packages/pyright-scip/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,13 @@ if (typeof module.setSourceMapsSupport === 'function') {
1515
const nodeOptions = process.env.NODE_OPTIONS || '';
1616
if (!nodeOptions.includes('--enable-source-maps')) {
1717
if (nodeOptions) {
18-
console.warn('Source maps support not available. Consider adding --enable-source-maps to the existing NODE_OPTIONS environment variable.');
18+
console.warn(
19+
'Source maps support not available. Consider adding --enable-source-maps to the existing NODE_OPTIONS environment variable.'
20+
);
1921
} else {
20-
console.warn('Source maps support not available. Consider setting the NODE_OPTIONS environment variable to "--enable-source-maps".');
22+
console.warn(
23+
'Source maps support not available. Consider setting the NODE_OPTIONS environment variable to "--enable-source-maps".'
24+
);
2125
}
2226
}
2327
}

0 commit comments

Comments
 (0)