Skip to content

Commit 5c2fcbe

Browse files
xenovapdufour
authored andcommitted
Add support for Split pretokenizer w/ behavior=removed & invert=false
1 parent 7b1ce3c commit 5c2fcbe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+31003
-30798
lines changed

.github/workflows/format-check.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Prettier Check
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
format:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
node-version: [22]
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Use Node.js ${{ matrix.node-version }}
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: ${{ matrix.node-version }}
23+
cache: 'npm'
24+
25+
- name: Install dependencies
26+
run: npm ci
27+
28+
- name: format:check
29+
run: npm run format:check

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,7 @@ examples
66
scripts
77
types
88
*.md
9+
# Ignore python related files
10+
.venv
11+
# Mac files
12+
.DS_STORE

.prettierrc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
{
2+
"tabWidth": 4,
3+
"printWidth": 120,
24
"overrides": [
35
{
46
"files": ["tests/**/*.js"],
57
"options": {
6-
"printWidth": 10000000
8+
"printWidth": 10000000
79
}
810
}
911
]

jest.config.mjs

Lines changed: 130 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -4,188 +4,185 @@
44
*/
55

66
export default {
7-
// All imported modules in your tests should be mocked automatically
8-
// automock: false,
7+
// All imported modules in your tests should be mocked automatically
8+
// automock: false,
99

10-
// Stop running tests after `n` failures
11-
// bail: 0,
10+
// Stop running tests after `n` failures
11+
// bail: 0,
1212

13-
// Automatically clear mock calls, instances, contexts and results before every test
14-
clearMocks: true,
13+
// Automatically clear mock calls, instances, contexts and results before every test
14+
clearMocks: true,
1515

16-
// Indicates whether the coverage information should be collected while executing the test
17-
collectCoverage: true,
16+
// Indicates whether the coverage information should be collected while executing the test
17+
collectCoverage: true,
1818

19-
// An array of glob patterns indicating a set of files for which coverage information should be collected
20-
// collectCoverageFrom: undefined,
19+
// An array of glob patterns indicating a set of files for which coverage information should be collected
20+
// collectCoverageFrom: undefined,
2121

22-
// The directory where Jest should output its coverage files
23-
coverageDirectory: "coverage",
22+
// The directory where Jest should output its coverage files
23+
coverageDirectory: "coverage",
2424

25-
// An array of regexp pattern strings used to skip coverage collection
26-
coveragePathIgnorePatterns: [
27-
"node_modules",
28-
"tests",
29-
],
25+
// An array of regexp pattern strings used to skip coverage collection
26+
coveragePathIgnorePatterns: ["node_modules", "tests"],
3027

31-
// Indicates which provider should be used to instrument code for coverage
32-
coverageProvider: "v8",
28+
// Indicates which provider should be used to instrument code for coverage
29+
coverageProvider: "v8",
3330

34-
// A list of reporter names that Jest uses when writing coverage reports
35-
// coverageReporters: [
36-
// "json",
37-
// "text",
38-
// "lcov",
39-
// "clover"
40-
// ],
31+
// A list of reporter names that Jest uses when writing coverage reports
32+
// coverageReporters: [
33+
// "json",
34+
// "text",
35+
// "lcov",
36+
// "clover"
37+
// ],
4138

42-
// An object that configures minimum threshold enforcement for coverage results
43-
// coverageThreshold: undefined,
39+
// An object that configures minimum threshold enforcement for coverage results
40+
// coverageThreshold: undefined,
4441

45-
// A path to a custom dependency extractor
46-
// dependencyExtractor: undefined,
42+
// A path to a custom dependency extractor
43+
// dependencyExtractor: undefined,
4744

48-
// Make calling deprecated APIs throw helpful error messages
49-
// errorOnDeprecated: false,
45+
// Make calling deprecated APIs throw helpful error messages
46+
// errorOnDeprecated: false,
5047

51-
// The default configuration for fake timers
52-
// fakeTimers: {
53-
// "enableGlobally": false
54-
// },
48+
// The default configuration for fake timers
49+
// fakeTimers: {
50+
// "enableGlobally": false
51+
// },
5552

56-
// Force coverage collection from ignored files using an array of glob patterns
57-
// forceCoverageMatch: [],
53+
// Force coverage collection from ignored files using an array of glob patterns
54+
// forceCoverageMatch: [],
5855

59-
// A path to a module which exports an async function that is triggered once before all test suites
60-
// globalSetup: undefined,
56+
// A path to a module which exports an async function that is triggered once before all test suites
57+
// globalSetup: undefined,
6158

62-
// A path to a module which exports an async function that is triggered once after all test suites
63-
// globalTeardown: undefined,
59+
// A path to a module which exports an async function that is triggered once after all test suites
60+
// globalTeardown: undefined,
6461

65-
// A set of global variables that need to be available in all test environments
66-
// globals: {},
62+
// A set of global variables that need to be available in all test environments
63+
// globals: {},
6764

68-
// The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.
69-
// maxWorkers: "50%",
65+
// The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.
66+
// maxWorkers: "50%",
7067

71-
// An array of directory names to be searched recursively up from the requiring module's location
72-
// moduleDirectories: [
73-
// "node_modules"
74-
// ],
68+
// An array of directory names to be searched recursively up from the requiring module's location
69+
// moduleDirectories: [
70+
// "node_modules"
71+
// ],
7572

76-
// An array of file extensions your modules use
77-
// moduleFileExtensions: [
78-
// "js",
79-
// "mjs",
80-
// "cjs",
81-
// "jsx",
82-
// "ts",
83-
// "tsx",
84-
// "json",
85-
// "node"
86-
// ],
73+
// An array of file extensions your modules use
74+
// moduleFileExtensions: [
75+
// "js",
76+
// "mjs",
77+
// "cjs",
78+
// "jsx",
79+
// "ts",
80+
// "tsx",
81+
// "json",
82+
// "node"
83+
// ],
8784

88-
// A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
89-
// moduleNameMapper: {},
85+
// A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
86+
// moduleNameMapper: {},
9087

91-
// An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
92-
// modulePathIgnorePatterns: [],
88+
// An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
89+
// modulePathIgnorePatterns: [],
9390

94-
// Activates notifications for test results
95-
// notify: false,
91+
// Activates notifications for test results
92+
// notify: false,
9693

97-
// An enum that specifies notification mode. Requires { notify: true }
98-
// notifyMode: "failure-change",
94+
// An enum that specifies notification mode. Requires { notify: true }
95+
// notifyMode: "failure-change",
9996

100-
// A preset that is used as a base for Jest's configuration
101-
// preset: undefined,
97+
// A preset that is used as a base for Jest's configuration
98+
// preset: undefined,
10299

103-
// Run tests from one or more projects
104-
// projects: undefined,
100+
// Run tests from one or more projects
101+
// projects: undefined,
105102

106-
// Use this configuration option to add custom reporters to Jest
107-
// reporters: undefined,
103+
// Use this configuration option to add custom reporters to Jest
104+
// reporters: undefined,
108105

109-
// Automatically reset mock state before every test
110-
// resetMocks: false,
106+
// Automatically reset mock state before every test
107+
// resetMocks: false,
111108

112-
// Reset the module registry before running each individual test
113-
// resetModules: false,
109+
// Reset the module registry before running each individual test
110+
// resetModules: false,
114111

115-
// A path to a custom resolver
116-
// resolver: undefined,
112+
// A path to a custom resolver
113+
// resolver: undefined,
117114

118-
// Automatically restore mock state and implementation before every test
119-
// restoreMocks: false,
115+
// Automatically restore mock state and implementation before every test
116+
// restoreMocks: false,
120117

121-
// The root directory that Jest should scan for tests and modules within
122-
// rootDir: undefined,
118+
// The root directory that Jest should scan for tests and modules within
119+
// rootDir: undefined,
123120

124-
// A list of paths to directories that Jest should use to search for files in
125-
roots: ["./tests/"],
121+
// A list of paths to directories that Jest should use to search for files in
122+
roots: ["./tests/"],
126123

127-
// Allows you to use a custom runner instead of Jest's default test runner
128-
// runner: "jest-runner",
124+
// Allows you to use a custom runner instead of Jest's default test runner
125+
// runner: "jest-runner",
129126

130-
// The paths to modules that run some code to configure or set up the testing environment before each test
131-
// setupFiles: [],
127+
// The paths to modules that run some code to configure or set up the testing environment before each test
128+
// setupFiles: [],
132129

133-
// A list of paths to modules that run some code to configure or set up the testing framework before each test
134-
// setupFilesAfterEnv: [],
130+
// A list of paths to modules that run some code to configure or set up the testing framework before each test
131+
// setupFilesAfterEnv: [],
135132

136-
// The number of seconds after which a test is considered as slow and reported as such in the results.
137-
// slowTestThreshold: 5,
133+
// The number of seconds after which a test is considered as slow and reported as such in the results.
134+
// slowTestThreshold: 5,
138135

139-
// A list of paths to snapshot serializer modules Jest should use for snapshot testing
140-
// snapshotSerializers: [],
136+
// A list of paths to snapshot serializer modules Jest should use for snapshot testing
137+
// snapshotSerializers: [],
141138

142-
// The test environment that will be used for testing
143-
// testEnvironment: "jest-environment-node",
139+
// The test environment that will be used for testing
140+
// testEnvironment: "jest-environment-node",
144141

145-
// Options that will be passed to the testEnvironment
146-
// testEnvironmentOptions: {},
142+
// Options that will be passed to the testEnvironment
143+
// testEnvironmentOptions: {},
147144

148-
// Adds a location field to test results
149-
// testLocationInResults: false,
145+
// Adds a location field to test results
146+
// testLocationInResults: false,
150147

151-
// The glob patterns Jest uses to detect test files
152-
// testMatch: [
153-
// "**/__tests__/**/*.[jt]s?(x)",
154-
// "**/?(*.)+(spec|test).[tj]s?(x)"
155-
// ],
148+
// The glob patterns Jest uses to detect test files
149+
// testMatch: [
150+
// "**/__tests__/**/*.[jt]s?(x)",
151+
// "**/?(*.)+(spec|test).[tj]s?(x)"
152+
// ],
156153

157-
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
158-
// testPathIgnorePatterns: [
159-
// "\\\\node_modules\\\\"
160-
// ],
154+
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
155+
// testPathIgnorePatterns: [
156+
// "\\\\node_modules\\\\"
157+
// ],
161158

162-
// The regexp pattern or array of patterns that Jest uses to detect test files
163-
// testRegex: [],
159+
// The regexp pattern or array of patterns that Jest uses to detect test files
160+
// testRegex: [],
164161

165-
// This option allows the use of a custom results processor
166-
// testResultsProcessor: undefined,
162+
// This option allows the use of a custom results processor
163+
// testResultsProcessor: undefined,
167164

168-
// This option allows use of a custom test runner
169-
// testRunner: "jest-circus/runner",
165+
// This option allows use of a custom test runner
166+
// testRunner: "jest-circus/runner",
170167

171-
// A map from regular expressions to paths to transformers
172-
transform: {},
168+
// A map from regular expressions to paths to transformers
169+
transform: {},
173170

174-
// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
175-
// transformIgnorePatterns: [
176-
// "\\\\node_modules\\\\",
177-
// "\\.pnp\\.[^\\\\]+$"
178-
// ],
171+
// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
172+
// transformIgnorePatterns: [
173+
// "\\\\node_modules\\\\",
174+
// "\\.pnp\\.[^\\\\]+$"
175+
// ],
179176

180-
// An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
181-
// unmockedModulePathPatterns: undefined,
177+
// An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
178+
// unmockedModulePathPatterns: undefined,
182179

183-
// Indicates whether each individual test should be reported during the run
184-
// verbose: undefined,
180+
// Indicates whether each individual test should be reported during the run
181+
// verbose: undefined,
185182

186-
// An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode
187-
// watchPathIgnorePatterns: [],
183+
// An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode
184+
// watchPathIgnorePatterns: [],
188185

189-
// Whether to use watchman for file crawling
190-
// watchman: true,
186+
// Whether to use watchman for file crawling
187+
// watchman: true,
191188
};

jsconfig.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
2-
// Only include files in the src directory
3-
"include": ["src/**/*"],
4-
"compilerOptions": {
5-
// Tells the compiler to check JS files
6-
"checkJs": true,
7-
"target": "esnext",
8-
"module": "nodenext",
9-
"moduleResolution": "nodenext"
10-
},
11-
"typeAcquisition": {
12-
"include": ["jest"]
13-
}
2+
// Only include files in the src directory
3+
"include": ["src/**/*"],
4+
"compilerOptions": {
5+
// Tells the compiler to check JS files
6+
"checkJs": true,
7+
"target": "esnext",
8+
"module": "nodenext",
9+
"moduleResolution": "nodenext"
10+
},
11+
"typeAcquisition": {
12+
"include": ["jest"]
13+
}
1414
}

0 commit comments

Comments
 (0)