Skip to content

v.2.0 (clean arch) #52

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

Merged
merged 39 commits into from
Apr 13, 2025
Merged

v.2.0 (clean arch) #52

merged 39 commits into from
Apr 13, 2025

Conversation

ekalinin
Copy link
Owner

@ekalinin ekalinin commented Jun 29, 2024

  • Refactored the whole codebase (using clean architecture approach)
  • Added more e2e tests
  • Upgrade GH workflow

Generated by Copilot:

This pull request includes various updates and refactors to improve the functionality and maintainability of the codebase. The most important changes include updates to the GitHub Actions workflow, modifications to the Makefile, refactoring of the main application logic, and the introduction of new adapters and their corresponding tests.

Workflow and Build Improvements:

  • .github/workflows/go.yml: Updated the GitHub Actions workflow to use the latest versions of actions and tools, and added depth fetching for checkout.

Makefile Enhancements:

  • Makefile: Added new commands for running end-to-end tests with remote Markdown and HTML files, and improved the lint and test commands to cover all directories. [1] [2]

Application Logic Refactoring:

  • cmd/gh-md-toc/main.go: Refactored the main application logic to use the new app.Config structure and removed redundant functions for processing paths and standard input. [1] [2] [3]
  • ghdoc.go and ghtoc.go: Removed the old GHDoc and GHToc implementations, which have been replaced by new adapters and configurations. [1] [2]

New Adapters and Tests:

  • Adapters: Introduced new adapters for file checking, file writing, temporary file creation, and HTML conversion, along with their respective tests.
    • internal/adapters/filechecker.go and internal/adapters/filechecker_test.go: Added a file checker adapter to verify file existence. [1] [2]
    • internal/adapters/filetemper.go and internal/adapters/filetemper_test.go: Added a file temper adapter for creating temporary files. [1] [2]
    • internal/adapters/filewriter.go and internal/adapters/filewriter_test.go: Added a file writer adapter to handle file writing operations. [1] [2]
    • internal/adapters/htmlconverter.go and internal/adapters/htmlconverter_test.go: Added an HTML converter adapter to convert Markdown files to HTML. [1] [2]

Logger Enhancements:

  • internal/adapters/logger.go and internal/adapters/logger_test.go: Added a new logger adapter to handle logging with configurable debug mode. [1] [2]

@codecov-commenter
Copy link

codecov-commenter commented Jun 29, 2024

Codecov Report

Attention: Patch coverage is 88.39590% with 34 lines in your changes missing coverage. Please review.

Project coverage is 84.55%. Comparing base (a8881c8) to head (ca7eda4).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
internal/app/new.go 0.00% 30 Missing ⚠️
internal/adapters/tocgrabber_json.go 90.47% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #52      +/-   ##
==========================================
+ Coverage   83.80%   84.55%   +0.74%     
==========================================
  Files           1       16      +15     
  Lines         142      356     +214     
==========================================
+ Hits          119      301     +182     
- Misses         17       47      +30     
- Partials        6        8       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ekalinin ekalinin requested a review from Copilot April 6, 2025 08:43
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 47 out of 48 changed files in this pull request and generated 4 comments.

Files not reviewed (1)
  • Makefile: Language not supported

ekalinin and others added 4 commits April 6, 2025 11:47
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@ekalinin ekalinin requested a review from Copilot April 6, 2025 08:50
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 47 out of 48 changed files in this pull request and generated no comments.

Files not reviewed (1)
  • Makefile: Language not supported
Comments suppressed due to low confidence (1)

internal/adapters/filechecker_test.go:11

  • Relying on a hardcoded file path ("./filechecker.go") can lead to inconsistent test results in different environments. Consider creating a temporary file within the test to reliably verify file existence.
{"FileChecker: exists", "./filechecker.go", true},

@ekalinin ekalinin requested a review from Copilot April 6, 2025 09:17
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 47 out of 48 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • Makefile: Language not supported
Comments suppressed due to low confidence (1)

internal/adapters/filetemper.go:5

  • [nitpick] The name 'FileTemper' might be ambiguous; consider renaming it to 'FileTemp' or 'TempFile' for clarity.
type FileTemper struct {

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@ekalinin ekalinin merged commit 8b8a14d into master Apr 13, 2025
3 checks passed
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.

2 participants