Skip to content

chore: clean up code formatting and remove unused files - #45

Merged
evilpeach merged 1 commit into
mainfrom
feature/setup-cicd
Aug 4, 2025
Merged

chore: clean up code formatting and remove unused files#45
evilpeach merged 1 commit into
mainfrom
feature/setup-cicd

Conversation

@evilpeach

@evilpeach evilpeach commented Aug 4, 2025

Copy link
Copy Markdown
Collaborator
  • Removed deprecated ROADMAP.md file.
  • Cleaned up various files by removing trailing commas and ensuring consistent formatting.
  • Updated README to direct users to CONTRIBUTING.md for development guidelines.
  • Removed unused GitHub Actions workflow for testing.
  • Added more tests
  • Formatted all codes with Prettier

Summary by CodeRabbit

  • New Features

    • Added a contributing guide with setup, development, and code style instructions.
    • Introduced a Prettier configuration for consistent code formatting.
  • Chores

    • Enhanced continuous integration checks to include linting, formatting, and type checking.
    • Updated project metadata, scripts, and added git hook automation for code quality.
  • Documentation

    • Simplified the README and removed the project roadmap.
  • Style

    • Removed all trailing commas and improved formatting across code, schemas, and test fixtures for consistency.
  • Tests

    • Applied formatting cleanups to test files and fixtures without altering test logic.

- Updated Jest configuration for consistent formatting.
- Removed deprecated ROADMAP.md file.
- Cleaned up various files by removing trailing commas and ensuring consistent formatting.
- Updated README to direct users to CONTRIBUTING.md for development guidelines.
- Removed unused GitHub Actions workflow for testing.
@evilpeach
evilpeach requested a review from simcheolhwan August 4, 2025 15:35
@coderabbitai

coderabbitai Bot commented Aug 4, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

This update introduces widespread code style changes, primarily removing trailing commas from object and array literals across the codebase, including source files, schemas, decoders, processors, and test fixtures. Additionally, it adds a Prettier configuration, expands CI checks to include linting and formatting, enhances package.json with new scripts and git hook automation, and introduces a CONTRIBUTING guide while removing the ROADMAP.

Changes

Cohort / File(s) Change Summary
CI and Project Configuration
.github/workflows/ci-tests.yml, .prettierrc, package.json, CONTRIBUTING.md, README.md, ROADMAP.md
CI workflow renamed and expanded to include lint, typecheck, and Prettier checks; new Prettier config added; package.json reorganized with new scripts, metadata, and git hook automation; CONTRIBUTING guide introduced; README streamlined; ROADMAP removed.
Jest Config
jest.config.ts
Removed trailing commas from object literals in Jest config.
Source: Formatting Cleanup
src/api.ts, src/balance-changes.ts, src/constants.ts, src/decoder.ts, src/decoders/**/*, src/message-types.ts, src/metadata-resolver.ts, src/processors/*
Removed trailing commas from object and array literals, imports, and destructurings throughout source files; no logic or functional changes.
Schemas: Formatting Cleanup
src/schema/common.ts, src/schema/events.ts, src/schema/messages.ts, src/schema/packet.ts, src/schema/registry.ts, src/schema/resources.ts, src/schema/rest.ts, src/schema/transaction.ts, src/schema/validators.ts, src/schema/view.ts
Removed trailing commas from object and array literals in all schema definitions; no changes to validation logic or types.
Tests and Fixtures: Formatting Cleanup
src/tests/**/*.ts, src/tests/fixtures/**/*.ts
Removed trailing commas and adjusted whitespace in all test and fixture files; no changes to test logic or data content.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant GitHub Actions
    participant Linter
    participant TypeChecker
    participant Prettier
    participant Test Runner

    Developer->>GitHub Actions: Push or PR triggers CI
    GitHub Actions->>Linter: Run ESLint (pnpm lint)
    GitHub Actions->>TypeChecker: Run TypeScript typecheck (pnpm typecheck)
    GitHub Actions->>Prettier: Check formatting (pnpm prettier --check)
    GitHub Actions->>Test Runner: Run tests (pnpm test)
    Test Runner-->>GitHub Actions: Report results
    GitHub Actions-->>Developer: CI status feedback
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

From fields of code, a bunny hops,
Removing commas—snip, snip, snop!
Prettier rules now guide the way,
While CI checks keep bugs at bay.
The roadmap’s gone, but docs are new,
With tidy code, our garden grew!
🐇✨


🪧 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.
    • Explain this complex logic.
    • 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 explain this code block.
  • 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 explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate sequence diagram to generate a sequence diagram of the changes in this 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🔭 Outside diff range comments (1)
src/metadata-resolver.ts (1)

27-34: Handle rejected promises from Promise.allSettled

Only the "fulfilled" branch is inspected. If any metadata request is rejected, the failure is silently ignored – the caller receives no hint that something went wrong. This can mask upstream API issues and make troubleshooting difficult.

   const metadata = nftMetadata.reduce<Metadata>((acc, promise, index) => {
-    if (promise.status === "fulfilled") {
+    if (promise.status === "fulfilled") {
       …
       return acc;
+    } else if (promise.status === "rejected") {
+      console.error(
+        `Failed to resolve metadata for object address ${tokenAddresses[index]}:`,
+        promise.reason
+      );
+      return acc;
     }
     return acc;
   }, {});

Adding the rejected branch keeps behaviour unchanged (no entry added) while at least surfacing the error for observability.

🧹 Nitpick comments (5)
src/decoder.ts (1)

13-14: Merge duplicate imports from the same module

attachTxLogs, mergeBalanceChanges, and createNotSupportedMessage are imported from "./utils" in two separate statements. Consolidating them into a single import improves readability and avoids redundant module resolution.

-import { attachTxLogs, mergeBalanceChanges } from "./utils";
-import { createNotSupportedMessage } from "./utils";
+import {
+  attachTxLogs,
+  mergeBalanceChanges,
+  createNotSupportedMessage
+} from "./utils";
.prettierrc (1)

1-4: Prettier config introduced – consider pinning additional rules
printWidth and trailingComma are set, but common defaults like "singleQuote": true or "arrowParens": "always" are not specified. Adding them now avoids future churn if the team decides on those conventions.

src/decoders/ibc/nft.ts (2)

100-108: Prefer ?? over || for nullable URI fallback

Using the nullish-coalescing operator avoids treating an empty string as “missing”:

-          uri: collection.data.uri || parsedData.data.classUri
+          uri: collection.data.uri ?? parsedData.data.classUri

Same applies below in the receive decoder.


226-232: Apply the same nullish-coalescing fix here

-          uri: collection.data.uri || parsedData.data.classUri
+          uri: collection.data.uri ?? parsedData.data.classUri
package.json (1)

32-40: Consider making CI lint fail on unfixable issues

Running eslint --fix in the lint script silently modifies code. For deterministic CI you might separate the commands:

-    "lint": "eslint \"{src,tests}/**/*.ts\" --fix",
+    "lint": "eslint \"{src,tests}/**/*.ts\" --max-warnings 0",
+    "lint:fix": "eslint \"{src,tests}/**/*.ts\" --fix",

This allows pnpm lint to fail when issues remain while still exposing an explicit auto-fix target.

Comment thread src/decoders/move/redelegate-locked.ts
Comment thread src/decoders/redelegate.ts
Comment thread src/processors/mint.ts
@evilpeach
evilpeach merged commit 7d4b42c into main Aug 4, 2025
2 checks passed
@evilpeach
evilpeach deleted the feature/setup-cicd branch August 4, 2025 15:46
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