feat: add configuration files for Prettier and EditorConfig#156
Conversation
aaudzei
left a comment
There was a problem hiding this comment.
The EditorConfig part is fine but the prettier is incomplete in my opinion.
If we are introducing it then all code has to be adjusted to meet the settings.
I tried npm run format and it generated changes to 40+ files that are not part of this PR.
Another thing to consider is enforcing it in CI. E.g. run format and use git to verify that no files were changed
|
@polatengin it would be great to complete this PR by incorporating @aaudzei feedback which is great |
> @azure-devops/mcp@1.0.0 format > prettier --write . .azuredevops/pipelines/release.yml 20ms (unchanged) .devcontainer/devcontainer.json 24ms (unchanged) .github/acl/access.yml 3ms (unchanged) .github/copilot-instructions.md 19ms (unchanged) .github/dependabot.yml 2ms (unchanged) .github/ISSUE_TEMPLATE/JitAccess.yml 3ms (unchanged) .github/ISSUE_TEMPLATE/NewTool.md 7ms (unchanged) .github/PULL_REQUEST_TEMPLATE.md 7ms (unchanged) .github/workflows/build.yml 5ms (unchanged) .github/workflows/codeql.yml 8ms (unchanged) .github/workflows/dependency-review.yml 2ms (unchanged) .github/workflows/version-update.yml 3ms (unchanged) .prettierrc.json 2ms (unchanged) CODE_OF_CONDUCT.md 3ms (unchanged) CONTRIBUTING.md 9ms (unchanged) docs/FAQ.md 4ms (unchanged) docs/HOWTO.md 18ms (unchanged) docs/TROUBLESHOOTING.md 6ms (unchanged) eslint.config.mjs 8ms (unchanged) jest.config.cjs 2ms (unchanged) LICENSE.md 1ms (unchanged) mcp.json 1ms (unchanged) package-lock.json 54ms (unchanged) package.json 1ms (unchanged) README.md 38ms (unchanged) SECURITY.md 5ms (unchanged) src/index.ts 42ms (unchanged) src/prompts.ts 9ms (unchanged) src/tools.ts 4ms (unchanged) src/tools/auth.ts 5ms (unchanged) src/tools/builds.ts 30ms (unchanged) src/tools/core.ts 9ms (unchanged) src/tools/releases.ts 11ms (unchanged) src/tools/repos.ts 31ms (unchanged) src/tools/search.ts 22ms (unchanged) src/tools/testplans.ts 19ms (unchanged) src/tools/wiki.ts 11ms (unchanged) src/tools/work.ts 9ms (unchanged) src/tools/workitems.ts 31ms (unchanged) src/utils.ts 1ms (unchanged) src/version.ts 0ms (unchanged) SUPPORT.md 1ms (unchanged) test/mocks/work-items.ts 12ms (unchanged) test/src/tools/core.test.ts 11ms (unchanged) test/src/tools/testplan.test.ts 8ms (unchanged) test/src/tools/wiki.test.ts 17ms (unchanged) test/src/tools/work.test.ts 17ms (unchanged) test/src/tools/workitems.test.ts 24ms (unchanged) tsconfig.json 1ms (unchanged)
| - **DO** include any relevant REST endpoints you wish to integrate with. Refer to the [public REST API documentation](https://learn.microsoft.com/en-us/rest/api/azure/devops). | ||
|
|
||
| For reference, see [this example of a well-formed issue](<repo>_issues/41). | ||
| For reference, see [this example of a well-formed issue](<repo>\_issues/41). |
There was a problem hiding this comment.
updated to fix the malformatted url 👍
| "start": "node -r tsconfig-paths/register dist/index.js", | ||
| "eslint": "eslint", | ||
| "eslint-fix": "eslint --fix", | ||
| "format": "prettier --write --end-of-line=lf .", |
There was a problem hiding this comment.
is the --end-of-line necessary in this and following line?
It is already present in .prettierrc.json
There was a problem hiding this comment.
I removed these extra flags, pipelines are passing 👍
| releaseIdFilter, | ||
| path, | ||
| }) => { | ||
| async ({ project, definitionId, definitionEnvironmentId, searchText, createdBy, statusFilter, environmentStatusFilter, minCreatedTime, maxCreatedTime, queryOrder, top, continuationToken, expand, artifactTypeId, sourceId, artifactVersionId, sourceBranchFilter, isDeleted, tagFilter, propertyFilters, releaseIdFilter, path }) => { |
There was a problem hiding this comment.
I think previous version of this code block is more readable.
Is there a rule to tweak to allow multiline in this case?
There was a problem hiding this comment.
changed the printWidth to 200, new format produces more readable and maintainable code
…formatting commands; refactor async function parameters for better readability in workitem tools
Minor fixes to complement #156 ## GitHub issue number #41 ## ✅ **PR Checklist** - [ ] **I have read the [contribution guidelines](https://github.com/microsoft/azure-devops-mcp/blob/main/CONTRIBUTING.md)** - [ ] **I have read the [code of conduct guidelines](https://github.com/microsoft/azure-devops-mcp/blob/main/CODE_OF_CONDUCT.md)** - [ ] Title of the pull request is clear and informative. - [ ] 👌 Code hygiene - [ ] 🔭 Telemetry added, updated, or N/A - [ ] 📄 Documentation added, updated, or N/A - [ ] 🛡️ Automated tests added, or N/A ## 🧪 **How did you test it?** N/A
Minor fixes to complement microsoft/azure-devops-mcp#156 ## GitHub issue number microsoft/azure-devops-mcp#41 ## ✅ **PR Checklist** - [ ] **I have read the [contribution guidelines](https://github.com/microsoft/azure-devops-mcp/blob/main/CONTRIBUTING.md)** - [ ] **I have read the [code of conduct guidelines](https://github.com/microsoft/azure-devops-mcp/blob/main/CODE_OF_CONDUCT.md)** - [ ] Title of the pull request is clear and informative. - [ ] 👌 Code hygiene - [ ] 🔭 Telemetry added, updated, or N/A - [ ] 📄 Documentation added, updated, or N/A - [ ] 🛡️ Automated tests added, or N/A ## 🧪 **How did you test it?** N/A

Having
editorconfigandprettierin the project automatically enforce consistent code formatting and style across all developers and files. This eliminates debates over style, reduces errors, and keeps the codebase clean and readable.This pull request introduces configuration files for
editorconfigandprettier.The
.editorconfigfile sets basic editor settings like using 2-space indents and ensuring a consistent line ending style, so everyone's editor behaves the same way when working on files.The
.prettierrc.jsonconfig apply specific formatting rules such as;Also with
.prettierignoreconfig we skip formatting certain directories and files.Together, these files ensure that all code contributed to the project looks consistent and adheres to a predefined style.
GitHub issue number
Fixes #41
Associated Risks
None
✅ PR Checklist
🧪 How did you test it?
Run
npm run formatat the root of the repo