Skip to content

Conversation

@faelmori
Copy link
Collaborator

This pull request introduces significant improvements and refinements to the gastype project, focusing on clarifying project documentation, enhancing configuration handling, and expanding the code transformation context for better optimization and maintainability. The most important changes are grouped below by theme.

Documentation and Branding Updates:

  • Major rewrite and expansion of README.md to better describe gastype as a Go AST-based transpilation and code analysis tool, with clearer feature lists, updated usage instructions, and improved organization. The branding has shifted from "Revolutionary Transpiler" to simply "Transpiler" throughout the documentation.
  • All references to "Revolutionary Transpiler" in code-generated comments, logs, build scripts, and project READMEs have been updated to "Transpiler" for consistency and clarity. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]

Configuration and Dependency Handling:

  • Improved default directory resolution in Config.Load(): if no directory is specified, it now uses the executable's directory as the default, ensuring more robust and predictable behavior. [1] [2]
  • Removed an unused dependency (github.com/rafa-mori/grompt) from go.mod for a cleaner dependency tree.

Transpilation Context and Struct Transformation Enhancements:

  • Extended StructInfo and TranspileContext to track and retrieve default values for struct boolean fields, enabling more precise and context-aware code transformations. Added DefaultValues to StructInfo, and new methods for accessing struct info and default values in TranspileContext. [1] [2] [3]
  • Updated the AddStruct method in TranspileContext to accept and store default values for struct fields, supporting more advanced transpilation passes.

AST Utilities and Type Checking:

  • Introduced the CheckConstant utility function in astutil/strings.go to determine if an AST node is a constant of a specific type, improving the accuracy of type analysis during code transformation.
  • Added missing imports in astutil/types.go for AST and token handling, preparing for future enhancements.

These changes collectively improve the usability, reliability, and extensibility of the gastype tool, making it easier for developers to optimize and secure their Go codebases.

faelmori and others added 6 commits August 26, 2025 19:14
Signed-off-by: Mori <[email protected]>
This pull request makes two main types of improvements: it refactors the
logging in the pipeline CLI to use a centralized logger, and it updates
the Makefile to use a new manifest location and adjust binary output
paths. The logger refactor ensures consistent, structured logging and
better error reporting throughout the pipeline commands, while the
Makefile changes align the build process with a new project structure
and output conventions.

**Logging and CLI improvements:**

* Replaces all direct `fmt` and previous logger (`l.Info`) calls in
`cmd/cli/pipeline.go` with the new centralized logger `gl.Log`,
providing consistent log levels (info/error) and improving error
visibility throughout all pipeline stages.
[[1]](diffhunk://#diff-31683e2fa776cdb0c60eeda4f9f0709785a2499f8557a9da3b1836dc187b0c88L17-R19)
[[2]](diffhunk://#diff-31683e2fa776cdb0c60eeda4f9f0709785a2499f8557a9da3b1836dc187b0c88L195-R203)
[[3]](diffhunk://#diff-31683e2fa776cdb0c60eeda4f9f0709785a2499f8557a9da3b1836dc187b0c88L219-R260)
[[4]](diffhunk://#diff-31683e2fa776cdb0c60eeda4f9f0709785a2499f8557a9da3b1836dc187b0c88L262-R312)
[[5]](diffhunk://#diff-31683e2fa776cdb0c60eeda4f9f0709785a2499f8557a9da3b1836dc187b0c88L309-R334)
[[6]](diffhunk://#diff-31683e2fa776cdb0c60eeda4f9f0709785a2499f8557a9da3b1836dc187b0c88L332-R388)
[[7]](diffhunk://#diff-31683e2fa776cdb0c60eeda4f9f0709785a2499f8557a9da3b1836dc187b0c88R399-R403)
[[8]](diffhunk://#diff-31683e2fa776cdb0c60eeda4f9f0709785a2499f8557a9da3b1836dc187b0c88L411-R430)
[[9]](diffhunk://#diff-31683e2fa776cdb0c60eeda4f9f0709785a2499f8557a9da3b1836dc187b0c88L425-R450)
[[10]](diffhunk://#diff-31683e2fa776cdb0c60eeda4f9f0709785a2499f8557a9da3b1836dc187b0c88L445-R470)
[[11]](diffhunk://#diff-31683e2fa776cdb0c60eeda4f9f0709785a2499f8557a9da3b1836dc187b0c88L467-R492)
[[12]](diffhunk://#diff-31683e2fa776cdb0c60eeda4f9f0709785a2499f8557a9da3b1836dc187b0c88L486-R513)
[[13]](diffhunk://#diff-31683e2fa776cdb0c60eeda4f9f0709785a2499f8557a9da3b1836dc187b0c88L540-R560)
[[14]](diffhunk://#diff-31683e2fa776cdb0c60eeda4f9f0709785a2499f8557a9da3b1836dc187b0c88L560-R584)
[[15]](diffhunk://#diff-31683e2fa776cdb0c60eeda4f9f0709785a2499f8557a9da3b1836dc187b0c88L573-R593)
[[16]](diffhunk://#diff-31683e2fa776cdb0c60eeda4f9f0709785a2499f8557a9da3b1836dc187b0c88L611-R680)

**Makefile and build process updates:**

* Changes the manifest file path in the Makefile from
`info/manifest.json` to `internal/module/info/manifest.json` for all
metadata extraction (app name, organization, repository, description,
binary name).
[[1]](diffhunk://#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52L8-R14)
[[2]](diffhunk://#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52L22-R24)
[[3]](diffhunk://#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52L32-R42)
* Updates the binary output directory from `bin/` to `dist/` in the
Makefile, reflecting a new convention for build artifacts.
* Removes documentation build and serve targets from the Makefile,
streamlining available commands.
* Cleans up the `clean` target by removing a specific docs artifact
(`kbxctl-docs`).
- Updated `NewConfigWithArgs` to set default directory based on executable path.
- Introduced `CheckConstant` function to verify AST nodes as specific constants.
- Added `InferExprType` to infer expression types in the AST.
- Implemented `CheckVariable` to check for variable existence and type in context.
- Enhanced `StringObfuscatePass` to obfuscate string literals and constants.
- Updated `ContextAnalyzer` to refine function complexity checks and dependency analysis.
- Modified `OutputManager` to skip standard library packages during import rewriting.
- Added new boolean conversion tests and enhanced main application logic.
- Updated Go module version to 1.25 and created a new test project for validation.

Signed-off-by: Rafael Mori <[email protected]>
This pull request introduces several important improvements to project
infrastructure, documentation, and workflow automation. It adds
standardized issue and pull request templates, a detailed code of
conduct, guidelines for Go development, and automation for dependency
updates. The Makefile has been significantly refactored to enhance
flexibility, maintainability, and integration with project metadata.

**Project workflow and automation:**

- Added standardized GitHub issue templates for bug reports and feature
requests to improve the quality and consistency of user feedback.
[[1]](diffhunk://#diff-185833cb26d7ac66a4d39042fd576a820c2c2c6d05ad18973bb9c7dce77267c5R1-R38)
[[2]](diffhunk://#diff-148870715557a13127284f8aeaa28002ed6b034268af13c5d030ab59fd078220R1-R20)
- Introduced a pull request template to ensure contributors follow best
practices and provide necessary information for reviewers.
- Added Dependabot configuration for automated weekly updates of Go
module dependencies.

**Documentation and standards:**

- Added a Contributor Covenant code of conduct to set clear expectations
for community behavior and enforcement.
- Added a Golang craftsmanship standards document with guidelines for
project structure, testing, naming, documentation, and best practices.
(.github/copilot-instructions.md)
- Improved the NOTICE file formatting for clarity and consistency.

**Build and configuration:**

- Major refactor of the `Makefile` to dynamically read project metadata
from `info/manifest.json`, improve logging, centralize
build/install/test logic via a support script, and enhance help
documentation.
- Added `.hintrc` configuration file to extend development settings.
@faelmori faelmori self-assigned this Aug 27, 2025
@faelmori faelmori merged commit 8f4f7c3 into notelm-refactor-viability-study Aug 27, 2025
2 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