Skip to content
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

L✔ ◾ Enhancing linting #537

Merged
merged 73 commits into from
Sep 6, 2024
Merged

L✔ ◾ Enhancing linting #537

merged 73 commits into from
Sep 6, 2024

Conversation

muiriswoulfe
Copy link
Member

@muiriswoulfe muiriswoulfe commented Sep 5, 2024

Summary

This change adds additional linting rules, to create a more prescriptive and less ad hoc design. This is designed to help facilitate external contributions to maintain the existing style.

These changes have been automatically or manually applied but are typically fairly mechanical. Therefore, there should be little risk of regression.

Detailed Summary

This includes several changes to improve code quality, update dependencies, and enhance error handling. The most important changes include updating the ESLint configuration, modifying the package.json file, and refactoring the GitInvoker class.

ESLint Configuration Updates:

  • Changed ESLint configuration to use recommended and strict type-checked settings, and replaced single quotes with double quotes for consistency. (eslint.config.mjs, eslint.config.mjsL6-R354)
  • Updated rules to enforce stricter linting, including rules such as @typescript-eslint/explicit-function-return-type and @typescript-eslint/no-unused-expressions. (eslint.config.mjs, eslint.config.mjsL6-R354)

package.json Modifications:

Code Refactoring:

  • Improved error handling in index.ts by adding a catch block to exit with a failure code. (src/task/index.ts, src/task/index.tsR9-R19)
  • Refactored GitInvoker class to remove redundant methods and use more concise syntax. (src/task/src/git/gitInvoker.ts, [1] [2] [3] [4] [5] [6] [7]

Testing

Test Types

  • Unit tests
  • Manual tests

Unit Test Coverage

100%

@muiriswoulfe muiriswoulfe added the enhancement New feature or request label Sep 5, 2024
@muiriswoulfe muiriswoulfe self-assigned this Sep 5, 2024
@muiriswoulfe muiriswoulfe requested a review from a team as a code owner September 5, 2024 14:40
@github-actions github-actions bot changed the title Enhancing linting L✔ ◾ Enhancing linting Sep 5, 2024
Copy link
Contributor

github-actions bot commented Sep 5, 2024

PR Metrics

Try to keep pull requests smaller than 400 lines of new product code by following the Single Responsibility Principle (SRP).
Thanks for adding tests.

Lines
Product Code 1,033
Test Code 1,978
Subtotal 3,011
Ignored Code 9
Total 3,020

Metrics computed by PR Metrics. Add it to your Azure DevOps and GitHub PRs!

@microsoft microsoft deleted a comment from azure-pipelines bot Sep 5, 2024
@microsoft microsoft deleted a comment from azure-pipelines bot Sep 5, 2024
@microsoft microsoft deleted a comment from azure-pipelines bot Sep 5, 2024
@microsoft microsoft deleted a comment from azure-pipelines bot Sep 5, 2024
@microsoft microsoft deleted a comment from azure-pipelines bot Sep 5, 2024
@muiriswoulfe
Copy link
Member Author

/AzurePipelines run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@muiriswoulfe muiriswoulfe enabled auto-merge (squash) September 5, 2024 19:14
@muiriswoulfe muiriswoulfe merged commit 7bfc023 into main Sep 6, 2024
29 checks passed
@muiriswoulfe muiriswoulfe deleted the muiriswoulfe/linting2 branch September 6, 2024 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants