-
Notifications
You must be signed in to change notification settings - Fork 2
Add CI pipeline checks to verify code formatting for TypeSpec, Markdown, and Rust files #523
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
base: main
Are you sure you want to change the base?
Conversation
…st code Co-authored-by: RickWinter <4430337+RickWinter@users.noreply.github.com>
|
The CI pipeline for this repo is an Azure DevOps pipeline, not a github workflow. Please fix this PR so it works with the existing pipeline. |
…mat existing code Co-authored-by: LarryOsterman <8220172+LarryOsterman@users.noreply.github.com>
Fixed! I've removed the GitHub Actions workflow and integrated the formatting checks into the existing Azure DevOps pipeline structure instead. The changes are in commit 8ebcc4f:
The formatting validation now runs as part of the existing CI pipeline after the lint step. |
|
/azp run Azure.typespec-rust |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
There appear to be CI pipeline errors related to formatting. |
Co-authored-by: LarryOsterman <8220172+LarryOsterman@users.noreply.github.com>
Fixed the CI formatting errors! The issue was a conflict between Prettier and ESLint indentation rules. I've resolved it by disabling the ESLint indent rule (which conflicts with Prettier) and applied proper formatting to the affected files. All formatting checks now pass. See commit 7b1afed. |
|
/azp run Azure.typespec-rust |
|
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements comprehensive CI formatting checks to ensure all TypeSpec, Markdown, and Rust source code follows defined formatting rules. The implementation includes GitHub Actions workflows, developer scripts, and package integration to enforce consistent code style across the project.
Key Changes
- Automated CI pipeline checks for TypeScript/JavaScript (ESLint), Markdown/JSON (Prettier), Rust (rustfmt), and TypeSpec files
- Developer scripts for local formatting validation and auto-formatting
- Package integration with new npm scripts and Prettier dependency
Reviewed Changes
Copilot reviewed 37 out of 51 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
scripts/format-all.sh |
Auto-format all supported files with appropriate tools |
scripts/check-all-formats.sh |
Comprehensive format checking for all file types |
scripts/check-rust-format.sh |
Rust-specific formatting validation with edition handling |
scripts/check-typespec-format.sh |
TypeSpec file validation (basic syntax checking) |
packages/typespec-rust/package.json |
Added Prettier dependency and formatting npm scripts |
packages/typespec-rust/eslint.config.js |
Disabled indent rule to avoid conflicts with Prettier |
| Multiple TypeScript files | Applied consistent formatting using ESLint and Prettier |
| Documentation files | Updated formatting and added development workflow instructions |
Files not reviewed (1)
- packages/typespec-rust/pnpm-lock.yaml: Language not supported
…itors Co-authored-by: heaths <1532486+heaths@users.noreply.github.com>
Co-authored-by: heaths <1532486+heaths@users.noreply.github.com>
Co-authored-by: heaths <1532486+heaths@users.noreply.github.com>
|
Moving PRs we don't want for the release today to draft. @copilot, please rebase this PR. |
I'm unable to perform a git rebase operation due to environment limitations - force push is not available in my sandbox environment. Additionally, I can't fetch the latest changes from the remote due to authentication restrictions. Could you clarify what specific changes you'd like me to make? I can:
What would be the preferred approach for updating this PR? |
|
@copilot rebase the changes with main. |
Co-authored-by: RickWinter <4430337+RickWinter@users.noreply.github.com>
I'm unable to perform a git rebase operation due to environment limitations - force push is not available in my sandbox environment. Could you clarify what specific changes you'd like me to make? I can make new commits with changes or reorganize the code changes in another way. |
|
@copilot merge with main |
I'm unable to perform a git merge with main due to environment limitations - I cannot fetch from the remote repository due to authentication restrictions, and force push operations are not available in my sandbox environment. Could you clarify what specific changes you'd like me to make instead? I can:
What would be the preferred approach for updating this PR? |
This PR implements comprehensive CI formatting checks to ensure all TypeSpec, Markdown, and Rust source code follows the defined prettier and rustfmt rules, integrated with the existing Azure DevOps pipeline.
What's Added
Azure DevOps Integration
eng/pipelines/templates/steps/build-test.yaml- Added formatting checks to existing CI pipelineeng/pipelines/templates/steps/set-env.yaml- Added prettier installationDeveloper Scripts
scripts/check-all-formats.sh- Comprehensive format checking for all file typesscripts/format-all.sh- Auto-format all supported filesscripts/check-rust-format.sh- Rust-specific formatting with proper edition handlingscripts/check-typespec-format.sh- TypeSpec file validation (prettier parser not available)Package Integration
Updated
packages/typespec-rust/package.jsonwith:format,format:check,format:prettier,format:eslintConfiguration
.prettierignore- Excludes generated code, build artifacts, and .tsp files.editorconfig- Consistent formatting rules across different editors to prevent unnecessary whitespace changes.prettierrc,eslint.config.js,rust-toolchain.toml)Documentation
.github/copilot-instructions.md- Added guidance on source regeneration and testing procedures including TypeSpec compilation, running tests, and operating the spector serverUsage
Local Development:
Source Generation and Testing:
CI Pipeline:
File Type Coverage
The implementation handles edge cases like generated test files with Rust edition conflicts and provides clear error messages for developers.
Fixes #516.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.