Skip to content

feat: add configuration files for Prettier and EditorConfig#156

Merged
aaudzei merged 12 commits into
microsoft:mainfrom
polatengin:polatengin/add-editorconfig-prettier
Jul 10, 2025
Merged

feat: add configuration files for Prettier and EditorConfig#156
aaudzei merged 12 commits into
microsoft:mainfrom
polatengin:polatengin/add-editorconfig-prettier

Conversation

@polatengin

Copy link
Copy Markdown
Contributor

Having editorconfig and prettier 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 and prettier.

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;

  • using semicolons
  • trailing commas for ES5 compatibility,
  • keeping brackets on the same line
  • printWidth is set very high (800) which effectively disables line wrapping.

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

  • I have read the contribution guidelines
  • I have read the code of conduct guidelines
  • 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?

Run npm run format at the root of the repo

@aaudzei aaudzei left a comment

Copy link
Copy Markdown
Contributor

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

@kboom

kboom commented Jul 8, 2025

Copy link
Copy Markdown
Contributor

@polatengin it would be great to complete this PR by incorporating @aaudzei feedback which is great

@polatengin polatengin requested a review from a team as a code owner July 8, 2025 20:25
> @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)
Comment thread CONTRIBUTING.md Outdated
- **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).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This does not render as a URL

Image

Copy link
Copy Markdown
Contributor Author

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 👍

Comment thread package.json Outdated
"start": "node -r tsconfig-paths/register dist/index.js",
"eslint": "eslint",
"eslint-fix": "eslint --fix",
"format": "prettier --write --end-of-line=lf .",

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor Author

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 👍

Comment thread 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 }) => {

Copy link
Copy Markdown
Contributor

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?

Copy link
Copy Markdown
Contributor Author

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

@aaudzei aaudzei merged commit 2c212b2 into microsoft:main Jul 10, 2025
5 checks passed
danhellem pushed a commit that referenced this pull request Jul 10, 2025
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
Ted-am pushed a commit to Ted-am/azure-devops-mcp that referenced this pull request Aug 29, 2025
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

implement a common editor config to have unified format for files

3 participants