Skip to content

Commit

Permalink
chore(repo): set noUncheckedAccess config (#630)
Browse files Browse the repository at this point in the history
* set noUncheckedAccess config

* chore: committing generated dist

* Update remove-pr-from-merge-queue.test.ts

* Update remove-pr-from-merge-queue.test.ts

---------

Co-authored-by: danadajian <[email protected]>
  • Loading branch information
danadajian and danadajian authored Jul 9, 2024
1 parent 4eac6e9 commit f4822c9
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion dist/431.index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/431.index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/676.index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/676.index.js.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions dist/839.index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/839.index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/helpers/approvals-satisfied.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export const approvalsSatisfied = async ({
const numberOfApprovals = approverLogins.filter(login => codeOwnerLogins.includes(login)).length;

const numberOfRequiredReviews =
teamOverrides?.find(({ team }) => entry.owners.includes(team))?.numberOfRequiredReviews ?? number_of_reviewers;
teamOverrides?.find(({ team }) => team && entry.owners.includes(team))?.numberOfRequiredReviews ?? number_of_reviewers;
core.info(`Current number of approvals satisfied for ${entry.owners}: ${numberOfApprovals}`);
core.info(`Number of required reviews: ${numberOfRequiredReviews}`);

Expand Down
1 change: 1 addition & 0 deletions src/helpers/generate-matrix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export const generateMatrix = ({ paths, batches: _batches = '1', load_balancing_
let currentLoadSize = 0;
let currentBatch: string[] = [];
matrixValues.forEach((path, index) => {
if (!loadBalancingSizes[index]) throw new Error('load_balancing_sizes input must contain values');
const possibleLoadSize = currentLoadSize + loadBalancingSizes[index];
if (Math.abs(possibleLoadSize - targetLoadSize) <= Math.abs(loadBalancingSizes[index] - targetLoadSize)) {
currentLoadSize += loadBalancingSizes[index];
Expand Down
6 changes: 3 additions & 3 deletions test/helpers/get-changed-files.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@ describe('getChangedFiles', () => {
it('case where one of the file paths match the file paths that octokit returns', async () => {
const result = await getChangedFiles({});

expect(result).toEqual(`${mock_data1[0].filename},${mock_data1[1].filename},${mock_data2[0].filename}`);
expect(result).toEqual(`${mock_data1[0]!.filename},${mock_data1[1]!.filename},${mock_data2[0]!.filename}`);
});

it('case where files returned from getChangedFiles matches the provided regex pattern', async () => {
const result = await getChangedFiles({ pattern: 'file/path/1/file[0-9].txt' });

expect(result).toEqual(`${mock_data1[0].filename}`);
expect(result).toEqual(`${mock_data1[0]!.filename}`);
});

it('case where files returned from getChangedFiles does not match the provided regex pattern', async () => {
Expand All @@ -116,6 +116,6 @@ describe('getChangedFiles', () => {
}));
const result = await getChangedFiles({ ignore_deleted: 'true' });

expect(result).toEqual(mock_data3[0].filename);
expect(result).toEqual(mock_data3[0]!.filename);
});
});
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"noEmit": true,
"strict": true,
"noImplicitAny": true,
"noUncheckedIndexedAccess": true,
"esModuleInterop": true,
"skipLibCheck": true,
"sourceMap": true,
Expand Down

0 comments on commit f4822c9

Please sign in to comment.