Skip to content

Conversation

@MattKotsenas
Copy link
Collaborator

@MattKotsenas MattKotsenas commented Oct 24, 2024

Add *.props and *.targets to XML section of .editorconfig template and fix .editorconfig violations.

This also aligns our .editorconfig with the upcoming dotnet/sdk#44441.

Summary by CodeRabbit

  • Chores
    • Updated .editorconfig to enhance formatting and naming conventions for XML and C# files.
    • Added new line at the end of Directory.Packages.props file.
    • Adjusted indentation in Moq.CodeFixes.csproj for better readability.
    • Added new line at the end of Moq.Analyzers.Test.csproj file.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 24, 2024

📝 Walkthrough

Walkthrough

The changes include updates to the .editorconfig file to enhance formatting and naming conventions for C# and XML files. The configuration for XML files now applies to .props and .targets files, with specified indentation settings. Additionally, minor modifications were made to the Directory.Packages.props file and the project files Moq.CodeFixes.csproj and Moq.Analyzers.Test.csproj, primarily involving whitespace adjustments and the addition of newlines.

Changes

File Change Summary
.editorconfig Updated file pattern for XML settings to include .props and .targets, set indentation sizes, and defined naming conventions and rules for C# and XML files.
Directory.Packages.props Added a newline at the end of the file; no other content changes.
src/CodeFixes/Moq.CodeFixes.csproj Adjusted indentation of XML elements within the project file; no content changes.
tests/Moq.Analyzers.Test/Moq.Analyzers.Test.csproj Added a newline at the end of the file; no other content changes.

Possibly related PRs

  • Refactor to support RS1038 #216: The changes in this PR involve modifications to the Directory.Packages.props file, which is also referenced in the main PR's .editorconfig changes, indicating a related focus on project configuration and settings.
  • Create a shared Common .projitems #235: This PR introduces a shared Common.projitems file and modifies project structures, which may relate to the overall organization and configuration settings discussed in the main PR's updates to .editorconfig.

Suggested labels

documentation, build, feature

Suggested reviewers

  • rjmurillo

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@rjmurillo rjmurillo added dependencies Pull requests that update a dependency file releasable labels Oct 24, 2024
@qlty-cloud-legacy
Copy link

Code Climate has analyzed commit b7b7312 and detected 0 issues on this pull request.

View more on Code Climate.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Outside diff range comments (1)
.editorconfig (1)

Line range hint 313-313: Fix incorrect type parameter symbol configuration.

The type parameter symbol is incorrectly configured to apply to namespaces instead of type parameters. This could prevent proper enforcement of the TPascalCase naming convention for type parameters (e.g., T in List<T>).

Apply this fix:

-dotnet_naming_symbols.type_parameters.applicable_kinds = namespace
+dotnet_naming_symbols.type_parameters.applicable_kinds = type_parameter
📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE

📥 Commits

Files that changed from the base of the PR and between b5ea5d3 and b7b7312.

📒 Files selected for processing (4)
  • .editorconfig (1 hunks)
  • Directory.Packages.props (1 hunks)
  • src/CodeFixes/Moq.CodeFixes.csproj (1 hunks)
  • tests/Moq.Analyzers.Test/Moq.Analyzers.Test.csproj (1 hunks)
🔇 Additional comments (4)
src/CodeFixes/Moq.CodeFixes.csproj (1)

4-6: LGTM! Consistent XML formatting applied.

The indentation changes align with standard MSBuild practices and the PR's objective to standardize XML formatting. The 2-space indentation is consistently applied across both PropertyGroup and ItemGroup sections while preserving all functional aspects of the project file.

Also applies to: 10-10

tests/Moq.Analyzers.Test/Moq.Analyzers.Test.csproj (1)

32-32: LGTM! Adding newline at EOF.

The addition of a newline character at the end of file follows standard text file best practices and aligns with common .editorconfig rules.

Directory.Packages.props (1)

36-36: LGTM! The newline addition follows best practices.

Adding a newline at the end of the file is a good practice and aligns with common XML formatting standards.

Let's verify the XML formatting rules in .editorconfig:

✅ Verification successful

The newline addition is consistent with the codebase's XML formatting

While we couldn't find an explicit .editorconfig file, the XML files in the repository consistently follow proper formatting with newlines at the end. The change aligns with the existing XML files' structure and common best practices for text files.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify .editorconfig XML formatting rules
# Expected: Should find rules for .props files with end_of_line settings

rg -A 3 '^\[*.props\]|^\[*.xml\]' .editorconfig

Length of output: 49


Script:

#!/bin/bash
# Let's first check if .editorconfig exists and see its content
fd -t f .editorconfig -x cat {}

# As a backup, let's also check for any XML/props related configuration files
fd -t f -e editorconfig -e props -e xml -e config --max-depth 2 -x cat {}

Length of output: 4402

.editorconfig (1)

8-9: LGTM! XML section changes look good.

The addition of .props and .targets files to the XML section with 2-space indentation aligns with common XML formatting practices.

@MattKotsenas
Copy link
Collaborator Author

Code Climate has analyzed commit b7b7312 and detected 0 issues on this pull request.

View more on Code Climate.

/cc @rjmurillo, this fixes some of the bot spam

@MattKotsenas MattKotsenas enabled auto-merge (squash) October 24, 2024 22:17
@MattKotsenas MattKotsenas merged commit f5f5ac6 into rjmurillo:main Oct 24, 2024
9 checks passed
@rjmurillo rjmurillo added this to the vNext milestone Oct 24, 2024
@MattKotsenas MattKotsenas deleted the refactor/editorconfig-props-targets branch October 24, 2024 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file releasable

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants