- Notifications
You must be signed in to change notification settings - Fork 77
feat: add configuration files for Prettier and EditorConfig #156
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
feat: add configuration files for Prettier and EditorConfig #156
Conversation
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.
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)
CONTRIBUTING.md Outdated
@@ -16,7 +16,7 @@ When creating an issue: | |||
- **DO** provide a detailed description of the issue or feature request. | |||
- **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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
updated to fix the malformatted url 👍
package.json Outdated
"build": "tsc && shx chmod +x dist/*.js", | ||
"prepare": "npm run build", | ||
"watch": "tsc --watch", | ||
"inspect": "npx @modelcontextprotocol/inspector node dist/index.js", | ||
"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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed these extra flags, pipelines are passing 👍
src/tools/releases.ts Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
Having
editorconfig
andprettier
in 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
editorconfig
andprettier
.The
.editorconfig
file 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.json
config apply specific formatting rules such as;Also with
.prettierignore
config 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 format
at the root of the repo