Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tsv path requirement check #24971

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions eng/tools/TypeSpecValidation/src/TypeSpecValidation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,17 @@ export async function main() {
const folder = parsedArgs.positionals[0];
console.log("Running TypeSpecValidation on folder:", folder);

// Verify specs' path requirements
let leafDir = folder.substring(folder.lastIndexOf(path.sep) + 1);
if (leafDir.includes(".") && !/\w\.[A-Z]/.test(leafDir)) {
throw new Error(
"Please rename the folder " +
leafDir +
" to " +
leafDir.replace(/\.\w/g, (l) => l.toUpperCase())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this also cause any other of the same letters to be upper cased in the path?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@weshaggard: I converted this PR back to draft. It will have significant changes before merging.

);
}

// Verify all specs are using root level pacakge.json
let expected_npm_prefix = process.cwd();
const actual_npm_prefix = (await runCmd(`npm prefix`, folder)).trim();
Expand Down
Loading