Skip to content

Commit

Permalink
fix(pacmak): remove disclaimer on compiling examples (#3148)
Browse files Browse the repository at this point in the history
We're pretty confident in our rosetta translations by now. If we
successfully compiled the example, no need to prefix it with
a disclaimer anymore: the translation is most likely correct.



---

By submitting this pull request, I confirm that my contribution is made under the terms of the [Apache 2.0 license].

[Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0
  • Loading branch information
rix0rrr committed Nov 9, 2021
1 parent 7ad9e0a commit 75e4093
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ import {
} from 'jsii-rosetta';
import * as xmlbuilder from 'xmlbuilder';

import {
INCOMPLETE_DISCLAIMER_COMPILING,
INCOMPLETE_DISCLAIMER_NONCOMPILING,
} from '..';
import { INCOMPLETE_DISCLAIMER_NONCOMPILING } from '..';
import { renderSummary } from '../_utils';
import { DotNetNameUtils } from './nameutils';

Expand Down Expand Up @@ -188,9 +185,6 @@ export class DotNetDocGenerator {
}

private prefixDisclaimer(translated: Translation) {
if (translated.didCompile && INCOMPLETE_DISCLAIMER_COMPILING) {
return `// ${INCOMPLETE_DISCLAIMER_COMPILING}\n${translated.source}`;
}
if (!translated.didCompile && INCOMPLETE_DISCLAIMER_NONCOMPILING) {
return `// ${INCOMPLETE_DISCLAIMER_NONCOMPILING}\n${translated.source}`;
}
Expand Down
4 changes: 1 addition & 3 deletions packages/jsii-pacmak/lib/targets/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,5 @@ export const ALL_BUILDERS: { [key in TargetName]: BuilderFactory } = {
new IndependentPackageBuilder(TargetName.PYTHON, Python, ms, o),
};

export const INCOMPLETE_DISCLAIMER_COMPILING =
'Example automatically generated. See https://github.com/aws/jsii/issues/826';
export const INCOMPLETE_DISCLAIMER_NONCOMPILING =
'Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826';
'Example automatically generated from non-compiling source. May contain errors.';
9 changes: 1 addition & 8 deletions packages/jsii-pacmak/lib/targets/java.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@ import { VERSION, VERSION_DESC } from '../version';
import { stabilityPrefixFor, renderSummary } from './_utils';
import { toMavenVersionRange, toReleaseVersion } from './version-utils';

import {
INCOMPLETE_DISCLAIMER_COMPILING,
INCOMPLETE_DISCLAIMER_NONCOMPILING,
TargetName,
} from '.';
import { INCOMPLETE_DISCLAIMER_NONCOMPILING, TargetName } from '.';

// eslint-disable-next-line @typescript-eslint/no-var-requires,@typescript-eslint/no-require-imports
const spdxLicenseList = require('spdx-license-list');
Expand Down Expand Up @@ -3013,9 +3009,6 @@ class JavaGenerator extends Generator {
}

private prefixDisclaimer(translated: Translation) {
if (translated.didCompile && INCOMPLETE_DISCLAIMER_COMPILING) {
return `// ${INCOMPLETE_DISCLAIMER_COMPILING}\n${translated.source}`;
}
if (!translated.didCompile && INCOMPLETE_DISCLAIMER_NONCOMPILING) {
return `// ${INCOMPLETE_DISCLAIMER_NONCOMPILING}\n${translated.source}`;
}
Expand Down
9 changes: 1 addition & 8 deletions packages/jsii-pacmak/lib/targets/python.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,7 @@ import {
import { die, toPythonIdentifier } from './python/util';
import { toPythonVersionRange, toReleaseVersion } from './version-utils';

import {
INCOMPLETE_DISCLAIMER_COMPILING,
INCOMPLETE_DISCLAIMER_NONCOMPILING,
TargetName,
} from '.';
import { INCOMPLETE_DISCLAIMER_NONCOMPILING, TargetName } from '.';

// eslint-disable-next-line @typescript-eslint/no-var-requires,@typescript-eslint/no-require-imports
const spdxLicenseList = require('spdx-license-list');
Expand Down Expand Up @@ -2400,9 +2396,6 @@ class PythonGenerator extends Generator {
}

private prefixDisclaimer(translated: Translation) {
if (translated.didCompile && INCOMPLETE_DISCLAIMER_COMPILING) {
return `# ${INCOMPLETE_DISCLAIMER_COMPILING}\n${translated.source}`;
}
if (!translated.didCompile && INCOMPLETE_DISCLAIMER_NONCOMPILING) {
return `# ${INCOMPLETE_DISCLAIMER_NONCOMPILING}\n${translated.source}`;
}
Expand Down

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

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

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

0 comments on commit 75e4093

Please sign in to comment.