Skip to content

Commit ee523db

Browse files
mrgraingithub-actions
andauthored
chore: lint projen files (#110)
Lint projen files as part of the build. --- By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license --------- Signed-off-by: github-actions <[email protected]> Co-authored-by: github-actions <[email protected]>
1 parent 55dac82 commit ee523db

File tree

6 files changed

+25
-20
lines changed

6 files changed

+25
-20
lines changed

.projen/tasks.json

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.projenrc.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,10 @@ function jestOptionsForProject(options: pj.javascript.JestOptions): pj.javascrip
146146
function transitiveFeaturesAndFixes(thisPkg: string, depPkgs: string[]) {
147147
return pj.ReleasableCommits.featuresAndFixes([
148148
'.',
149-
...depPkgs.map(p => path.relative(`packages/${thisPkg}`, `packages/${p}`))
149+
...depPkgs.map(p => path.relative(`packages/${thisPkg}`, `packages/${p}`)),
150150
].join(' '));
151151
}
152152

153-
154153
const repoProject = new yarn.Monorepo({
155154
projenrcTs: true,
156155
name: 'aws-cdk-cli',
@@ -225,8 +224,6 @@ const repoProject = new yarn.Monorepo({
225224
},
226225
});
227226

228-
new AdcPublishing(repoProject);
229-
230227
// Eslint for projen config
231228
// @ts-ignore
232229
repoProject.eslint = new pj.javascript.Eslint(repoProject, {
@@ -236,6 +233,12 @@ repoProject.eslint = new pj.javascript.Eslint(repoProject, {
236233
fileExtensions: ['.ts', '.tsx'],
237234
lintProjenRc: false,
238235
});
236+
// always lint projen files as part of the build
237+
if (repoProject.eslint?.eslintTask) {
238+
repoProject.tasks.tryFind('build')?.spawn(repoProject.eslint?.eslintTask);
239+
}
240+
241+
new AdcPublishing(repoProject);
239242

240243
const repo = configureProject(repoProject);
241244

projenrc/adc-publishing.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { Monorepo } from "cdklabs-projen-project-types/lib/yarn";
2-
import { Component, github } from "projen";
3-
import { JobPermission } from "projen/lib/github/workflows-model";
1+
import { Monorepo } from 'cdklabs-projen-project-types/lib/yarn';
2+
import { Component, github } from 'projen';
3+
import { JobPermission } from 'projen/lib/github/workflows-model';
44

55
export class AdcPublishing extends Component {
66
constructor(private readonly project_: Monorepo) {
@@ -22,19 +22,19 @@ export class AdcPublishing extends Component {
2222
with: {
2323
name: 'standalone_build-artifact',
2424
path: 'dist/standalone',
25-
overwrite: true
25+
overwrite: true,
2626
},
2727
});
2828

2929
releaseWf.addJob('standalone_release_adc', {
3030
name: 'standalone: publish to ADC',
31-
environment: 'releasing', // <-- this has the configuration
31+
environment: 'releasing', // <-- this has the configuration
3232
needs: ['release'],
3333
runsOn: ['ubuntu-latest'],
3434
permissions: {
3535
contents: JobPermission.WRITE,
3636
},
37-
if: `\${{ needs.release.outputs.latest_commit == github.sha }}`,
37+
if: '${{ needs.release.outputs.latest_commit == github.sha }}',
3838
steps: [
3939
{
4040
uses: 'actions/setup-node@v4',

projenrc/build-standalone-zip.task.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { glob } from 'glob';
77
async function main() {
88
const outdir = await fs.mkdtemp(path.join(os.tmpdir(), 'bundling'));
99
try {
10-
1110
const pkgs = ['aws-cdk'];
1211
// this is a build task, so we are safe either way
1312
// eslint-disable-next-line @cdklabs/promiseall-no-unbounded-parallelism

projenrc/codecov.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { Component, github } from "projen";
2-
import { JobPermission } from "projen/lib/github/workflows-model";
3-
import { TypeScriptProject } from "projen/lib/typescript";
1+
import { Component, github } from 'projen';
2+
import { JobPermission } from 'projen/lib/github/workflows-model';
3+
import { TypeScriptProject } from 'projen/lib/typescript';
44

55
export interface CodeCovWorkflowProps {
66
readonly restrictToRepos: string[];
@@ -52,10 +52,10 @@ export class CodeCovWorkflow extends Component {
5252
files: props.packages.map(p => `packages/${p}/coverage/cobertura-coverage.xml`).join(','),
5353
fail_ci_if_error: true,
5454
flags: 'suite.unit',
55-
use_oidc: true
55+
use_oidc: true,
5656
},
5757
},
5858
],
5959
});
6060
}
61-
}
61+
}

projenrc/jsii.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -471,10 +471,10 @@ export class JsiiBuild extends pj.Component {
471471
target: JsiiPacmakTarget,
472472
packTask: pj.Task,
473473
): {
474-
publishTools: Tools;
475-
bootstrapSteps: Array<Step>;
476-
packagingSteps: Array<Step>;
477-
} {
474+
publishTools: Tools;
475+
bootstrapSteps: Array<Step>;
476+
packagingSteps: Array<Step>;
477+
} {
478478
const bootstrapSteps: Array<Step> = [];
479479
const packagingSteps: Array<Step> = [];
480480

0 commit comments

Comments
 (0)