Skip to content

Conversation

guitarrapc
Copy link
Owner

tl;dr;

port C# DotfilesLinker to go.

@guitarrapc guitarrapc requested a review from Copilot April 21, 2025 10:10
Copy link
Contributor

@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.

Pull Request Overview

This PR ports the C# DotfilesLinker to Go by implementing core dotfile linking functionality, associated logging, and a suite of tests, along with supporting filesystem abstractions and CI/CD configurations.

  • Implements file linking service and logging in Go.
  • Provides comprehensive tests using a mock filesystem.
  • Adds CI/CD, release, and documentation updates.

Reviewed Changes

Copilot reviewed 20 out of 22 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
utils/path_utils.go Adds the PathEquals function for comparing file paths.
services/logger.go Introduces Logger interface and its implementations.
services/filelinker_service_test.go Provides tests covering various dotfiles linking scenarios.
services/filelinker_service.go Implements the dotfiles linking logic and directory processing.
infrastructure/mock_filesystem.go Implements a mock filesystem for testing purposes.
infrastructure/filesystem.go Defines the FileSystem interface.
infrastructure/default_filesystem.go Implements default filesystem operations.
cmd/dotfileslinker/main.go Application entry point and CLI configuration.
cliff.toml Configuration for changelog generation with git-cliff.
README_ja.md / README.md Project documentation in Japanese and English.
CHANGELOG.md Changelog with initial version notes.
.goreleaser.yml GoReleaser configuration for building and releasing.
.github/workflows/* CI/CD workflows for building, testing, releasing, and TOC generation.
.github/dependabot.yaml Dependabot configuration for GitHub Actions and Go modules.
.github/copilot-instructions.md Copilot-specific instructions for communication and code formatting.
Files not reviewed (2)
  • .editorconfig: Language not supported
  • go.mod: Language not supported

guitarrapc and others added 2 commits April 21, 2025 19:12
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@guitarrapc guitarrapc requested a review from Copilot April 21, 2025 10:17
Copy link
Contributor

@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.

Pull Request Overview

Port the original C# DotfilesLinker to Go with a complete implementation including services, tests, a mock filesystem, and updated GitHub Actions workflows.

  • Added utility functions (e.g. path comparison in utils/path_utils.go) and logging/service abstractions in services.
  • Implemented comprehensive tests with a mock filesystem and provided CI/CD configuration for building, testing, and releasing the Go application.

Reviewed Changes

Copilot reviewed 20 out of 22 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
utils/path_utils.go Added utility for comparing file paths with absolute resolution
services/logger.go Implemented logging interfaces and Console/Null loggers
services/filelinker_service.go Introduced main service functions for linking dotfiles
services/filelinker_service_test.go Added tests for various linkage scenarios
infrastructure/* Provided mock and default filesystem implementations
cmd/dotfileslinker/main.go Main application entrypoint with argument parsing
Additional config files (.goreleaser.yml, GitHub workflows, README, etc.) Documentation and CI/CD configurations supporting the port
Files not reviewed (2)
  • .editorconfig: Language not supported
  • go.mod: Language not supported

guitarrapc and others added 2 commits April 21, 2025 19:19
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@guitarrapc guitarrapc requested a review from Copilot April 21, 2025 10:35
Copy link
Contributor

@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.

Pull Request Overview

This PR ports the C# DotfilesLinker utility to Go, implementing the core file linking functionality along with filesystem abstractions and tests.

  • Introduces FileLinkerService with functions for linking dotfiles from the repository to appropriate directories.
  • Provides a comprehensive set of unit tests to cover various scenarios (normal linking, handling existing files with/without overwrite, and ignore list processing).
  • Adds a mock filesystem implementation to simulate platform-specific file operations during testing.

Reviewed Changes

Copilot reviewed 20 out of 22 changed files in this pull request and generated no comments.

Show a summary per file
File Description
utils/path_utils.go Added a helper function (PathEquals) for absolute path comparison.
services/logger.go Introduced ConsoleLogger and NullLogger implementations.
services/filelinker_service.go Core file linking logic implemented with directory processing and link creation.
services/filelinker_service_test.go Comprehensive test coverage for linking behavior and ignore list handling.
infrastructure/mock_filesystem.go A mock FileSystem implementation for testing purposes.
infrastructure/default_filesystem.go Default filesystem operations based on standard OS calls.
cmd/dotfileslinker/main.go Main entry point wiring up the configuration, logging, and service execution.
cliff.toml, README*, CHANGELOG.md, .goreleaser*, .github/* Configuration & documentation updates supporting the project build, release, and CI pipelines.
Files not reviewed (2)
  • .editorconfig: Language not supported
  • go.mod: Language not supported

@guitarrapc guitarrapc enabled auto-merge April 21, 2025 10:36
@guitarrapc guitarrapc merged commit 78b0332 into main Apr 21, 2025
9 checks passed
@guitarrapc guitarrapc deleted the init branch April 21, 2025 10:37
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.

1 participant