Skip to content

Conversation

@numbpill3d
Copy link
Owner

@numbpill3d numbpill3d commented Jun 8, 2025

User description

Summary

  • ensure all files in server/ and public/js/ end with a newline
  • add missing final newline to several root files

Testing

  • npm test (fails: Missing required Supabase environment variables)

https://chatgpt.com/codex/tasks/task_e_68450dde6a38832f83c6282e9f163fee


PR Type

enhancement


Description

  • Ensure all files end with a single newline character

  • Add missing final newlines to JavaScript, Handlebars, and Markdown files

  • Improve POSIX compatibility and code consistency

  • No functional or logic changes to application code


Changes walkthrough 📝

Relevant files
Enhancement
59 files
.eslintrc.js
Add final newline for POSIX compliance                                     
+1/-1     
forum.js
Add missing newline at end of file                                             
+1/-1     
laincore-loader.js
Add missing newline at end of file                                             
+1/-1     
laincore.js
Add missing newline at end of file                                             
+1/-1     
login.js
Add missing newline at end of file                                             
+1/-1     
register.js
Add missing newline at end of file                                             
+1/-1     
widgets.js
Add missing newline at end of file                                             
+1/-1     
theme.js
Add missing newline at end of file                                             
+1/-1     
Collection.js
Add missing newline at end of file                                             
+1/-1     
MarketItem.js
Add missing newline at end of file                                             
+1/-1     
Purchase.js
Add missing newline at end of file                                             
+1/-1     
ScrapyardItem.js
Add missing newline at end of file                                             
+1/-1     
Transaction.js
Add missing newline at end of file                                             
+1/-1     
User.js
Add missing newline at end of file                                             
+1/-1     
WIRTransaction.js
Add missing newline at end of file                                             
+1/-1     
Wishlist.js
Add missing newline at end of file                                             
+1/-1     
api.js
Add missing newline at end of file                                             
+1/-1     
feed.js
Add missing newline at end of file                                             
+1/-1     
forum.js
Add missing newline at end of file                                             
+1/-1     
market-api.js
Add missing newline at end of file                                             
+1/-1     
market.js
Add missing newline at end of file                                             
+1/-1     
user-market.js
Add missing newline at end of file                                             
+1/-1     
users.js
Add missing newline at end of file                                             
+1/-1     
database.js
Add missing newline at end of file                                             
+1/-1     
memory-monitor.js
Add missing newline at end of file                                             
+1/-1     
passport-config.js
Add missing newline at end of file                                             
+1/-1     
view-cache.js
Add missing newline at end of file                                             
+1/-1     
about.handlebars
Add missing newline at end of file                                             
+1/-1     
compatibility.handlebars
Add missing newline at end of file                                             
+1/-1     
flash-message.handlebars
Add missing newline at end of file                                             
+1/-1     
discover.handlebars
Add missing newline at end of file                                             
+1/-1     
error.handlebars
Add missing newline at end of file                                             
+1/-1     
faq.handlebars
Add missing newline at end of file                                             
+1/-1     
subscribe.handlebars
Add missing newline at end of file                                             
+1/-1     
category.handlebars
Add missing newline at end of file                                             
+1/-1     
index.handlebars
Add missing newline at end of file                                             
+1/-1     
new-thread.handlebars
Add missing newline at end of file                                             
+1/-1     
thread.handlebars
Add missing newline at end of file                                             
+1/-1     
browse.handlebars
Add missing newline at end of file                                             
+1/-1     
collection.handlebars
Add missing newline at end of file                                             
+1/-1     
collections.handlebars
Add missing newline at end of file                                             
+1/-1     
index.handlebars
Add missing newline at end of file                                             
+1/-1     
item.handlebars
Add missing newline at end of file                                             
+1/-1     
submit.handlebars
Add missing newline at end of file                                             
+1/-1     
collections.handlebars
Add missing newline at end of file                                             
+1/-1     
purchased.handlebars
Add missing newline at end of file                                             
+1/-1     
selling.handlebars
Add missing newline at end of file                                             
+1/-1     
wir.handlebars
Add missing newline at end of file                                             
+1/-1     
wishlist.handlebars
Add missing newline at end of file                                             
+1/-1     
privacy.handlebars
Add missing newline at end of file                                             
+1/-1     
profile.handlebars
Add missing newline at end of file                                             
+1/-1     
terminal.handlebars
Add missing newline at end of file                                             
+1/-1     
terms.handlebars
Add missing newline at end of file                                             
+1/-1     
login.handlebars
Add missing newline at end of file                                             
+1/-1     
register.handlebars
Add missing newline at end of file                                             
+1/-1     
CHANGELOG.md
Add missing newline at end of file                                             
+1/-1     
forum_improvement_plan.md
Add missing newline at end of file                                             
+1/-1     
vivid_market_architecture.md
Add missing newline at end of file                                             
+1/-1     
wirebase_ui_ux_audit_plan.md
Add missing newline at end of file                                             
+1/-1     

Need help?
  • Type /help how to ... in the comments thread for any questions about Qodo Merge usage.
  • Check out the documentation for more information.
  • @sourcery-ai
    Copy link
    Contributor

    sourcery-ai bot commented Jun 8, 2025

    Reviewer's Guide

    This PR enforces POSIX-compliant end-of-file newlines by adding missing final newline characters across server-side modules, client-side JavaScript assets, and root configuration/documentation files.

    File-Level Changes

    Change Details Files
    Add final newline to server-side files
    • Add missing newline at EOF in middleware, models, routes, and utils
    • Ensure all Handlebars view templates end with a newline
    server/middleware/theme.js
    server/models/Collection.js
    server/models/MarketItem.js
    server/models/Purchase.js
    server/models/ScrapyardItem.js
    server/models/Transaction.js
    server/models/User.js
    server/models/WIRTransaction.js
    server/models/Wishlist.js
    server/routes/api.js
    server/routes/feed.js
    server/routes/forum.js
    server/routes/market-api.js
    server/routes/market.js
    server/routes/user-market.js
    server/routes/users.js
    server/utils/database.js
    server/utils/memory-monitor.js
    server/utils/passport-config.js
    server/utils/view-cache.js
    server/views/about.handlebars
    server/views/compatibility.handlebars
    server/views/components/flash-message.handlebars
    server/views/discover.handlebars
    server/views/error.handlebars
    server/views/faq.handlebars
    server/views/feed/subscribe.handlebars
    server/views/forum/category.handlebars
    server/views/forum/index.handlebars
    server/views/forum/new-thread.handlebars
    server/views/forum/thread.handlebars
    server/views/market/browse.handlebars
    server/views/market/collection.handlebars
    server/views/market/collections.handlebars
    server/views/market/index.handlebars
    server/views/market/item.handlebars
    server/views/market/submit.handlebars
    server/views/market/user/collections.handlebars
    server/views/market/user/purchased.handlebars
    server/views/market/user/selling.handlebars
    server/views/market/user/wir.handlebars
    server/views/market/user/wishlist.handlebars
    server/views/privacy.handlebars
    server/views/profile/profile.handlebars
    server/views/profile/terminal.handlebars
    server/views/terms.handlebars
    server/views/users/login.handlebars
    server/views/users/register.handlebars
    Add final newline to client-side JavaScript assets
    • Insert missing newline at EOF in forum and loader scripts
    • Add newline at EOF in main, login, register, and widget scripts
    public/js/forum.js
    public/js/laincore-loader.js
    public/js/laincore.js
    public/js/login.js
    public/js/register.js
    public/js/widgets.js
    Add final newline to root configuration and documentation
    • Ensure root config and ESLint file end with newline
    • Append newline to changelog and markdown plans
    .eslintrc.js
    CHANGELOG.md
    forum_improvement_plan.md
    vivid_market_architecture.md
    wirebase_ui_ux_audit_plan.md

    Tips and commands

    Interacting with Sourcery

    • Trigger a new review: Comment @sourcery-ai review on the pull request.
    • Continue discussions: Reply directly to Sourcery's review comments.
    • Generate a GitHub issue from a review comment: Ask Sourcery to create an
      issue from a review comment by replying to it. You can also reply to a
      review comment with @sourcery-ai issue to create an issue from it.
    • Generate a pull request title: Write @sourcery-ai anywhere in the pull
      request title to generate a title at any time. You can also comment
      @sourcery-ai title on the pull request to (re-)generate the title at any time.
    • Generate a pull request summary: Write @sourcery-ai summary anywhere in
      the pull request body to generate a PR summary at any time exactly where you
      want it. You can also comment @sourcery-ai summary on the pull request to
      (re-)generate the summary at any time.
    • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
      request to (re-)generate the reviewer's guide at any time.
    • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
      pull request to resolve all Sourcery comments. Useful if you've already
      addressed all the comments and don't want to see them anymore.
    • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
      request to dismiss all existing Sourcery reviews. Especially useful if you
      want to start fresh with a new review - don't forget to comment
      @sourcery-ai review to trigger a new review!

    Customizing Your Experience

    Access your dashboard to:

    • Enable or disable review features such as the Sourcery-generated pull request
      summary, the reviewer's guide, and others.
    • Change the review language.
    • Add, remove or edit custom review instructions.
    • Adjust other review settings.

    Getting Help

    Copy link
    Contributor

    @gemini-code-assist gemini-code-assist bot left a comment

    Choose a reason for hiding this comment

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

    Hello @numbpill3d, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

    Summary of Changes

    Hello team, gemini-code-assist here with a summary of this pull request authored by numbpill3d. The primary goal of this PR, as indicated by the title and description, is to address inconsistent file formatting by ensuring that various files across the repository end with a newline character. This is a common code style preference that helps with compatibility across different tools and systems.

    Highlights

    • Code Style Consistency: This pull request enforces a consistent code style by adding missing newline characters at the end of numerous files.
    • Wide-ranging Application: The changes are applied to files in several directories, including root files, public/js/, and various subdirectories within server/ (middleware, models, routes, utils, views).

    Changelog

    Click here to see the changelog
    • .eslintrc.js
      • Added missing newline at end of file.
    • .gitignore
      • Added missing newline at end of file.
    • CHANGELOG.md
      • Added missing newline at end of file.
    • forum_improvement_plan.md
      • Added missing newline at end of file.
    • public/js/forum.js
      • Added missing newline at end of file.
    • public/js/laincore-loader.js
      • Added missing newline at end of file.
    • public/js/laincore.js
      • Added missing newline at end of file.
    • public/js/login.js
      • Added missing newline at end of file.
    • public/js/register.js
      • Added missing newline at end of file.
    • public/js/widgets.js
      • Added missing newline at end of file.
    • server/middleware/theme.js
      • Added missing newline at end of file.
    • server/models/Collection.js
      • Added missing newline at end of file.
    • server/models/MarketItem.js
      • Added missing newline at end of file.
    • server/models/Purchase.js
      • Added missing newline at end of file.
    • server/models/ScrapyardItem.js
      • Added missing newline at end of file.
    • server/models/Transaction.js
      • Added missing newline at end of file.
    • server/models/User.js
      • Added missing newline at end of file.
    • server/models/WIRTransaction.js
      • Added missing newline at end of file.
    • server/models/Wishlist.js
      • Added missing newline at end of file.
    • server/routes/api.js
      • Added missing newline at end of file.
    • server/routes/feed.js
      • Added missing newline at end of file.
    • server/routes/forum.js
      • Added missing newline at end of file.
    • server/routes/market-api.js
      • Added missing newline at end of file.
    • server/routes/market.js
      • Added missing newline at end of file.
    • server/routes/user-market.js
      • Added missing newline at end of file.
    • server/routes/users.js
      • Added missing newline at end of file.
    • server/utils/database.js
      • Added missing newline at end of file.
    • server/utils/memory-monitor.js
      • Added missing newline at end of file.
    • server/utils/passport-config.js
      • Added missing newline at end of file.
    • server/utils/view-cache.js
      • Added missing newline at end of file.
    • server/views/about.handlebars
      • Added missing newline at end of file.
    • server/views/compatibility.handlebars
      • Added missing newline at end of file.
    • server/views/components/flash-message.handlebars
      • Added missing newline at end of file.
    • server/views/discover.handlebars
      • Added missing newline at end of file.
    • server/views/error.handlebars
      • Added missing newline at end of file.
    • server/views/faq.handlebars
      • Added missing newline at end of file.
    • server/views/feed/subscribe.handlebars
      • Added missing newline at end of file.
    • server/views/forum/category.handlebars
      • Added missing newline at end of file.
    • server/views/forum/index.handlebars
      • Added missing newline at end of file.
    • server/views/forum/new-thread.handlebars
      • Added missing newline at end of file.
    • server/views/forum/thread.handlebars
      • Added missing newline at end of file.
    • server/views/market/browse.handlebars
      • Added missing newline at end of file.
    • server/views/market/collection.handlebars
      • Added missing newline at end of file.
    • server/views/market/collections.handlebars
      • Added missing newline at end of file.
    • server/views/market/index.handlebars
      • Added missing newline at end of file.
    • server/views/market/item.handlebars
      • Added missing newline at end of file.
    • server/views/market/submit.handlebars
      • Added missing newline at end of file.
    • server/views/market/user/collections.handlebars
      • Added missing newline at end of file.
    • server/views/market/user/purchased.handlebars
      • Added missing newline at end of file.
    • server/views/market/user/selling.handlebars
      • Added missing newline at end of file.
    • server/views/market/user/wir.handlebars
      • Added missing newline at end of file.
    • server/views/market/user/wishlist.handlebars
      • Added missing newline at end of file.
    • server/views/privacy.handlebars
      • Added missing newline at end of file.
    • server/views/profile/profile.handlebars
      • Added missing newline at end of file.
    • server/views/profile/terminal.handlebars
      • Added missing newline at end of file.
    • server/views/terms.handlebars
      • Added missing newline at end of file.
    • server/views/users/login.handlebars
      • Added missing newline at end of file.
    • server/views/users/register.handlebars
      • Added missing newline at end of file.
    • vivid_market_architecture.md
      • Added missing newline at end of file.
    • wirebase_ui_ux_audit_plan.md
      • Added missing newline at end of file.
    Using Gemini Code Assist

    The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

    Invoking Gemini

    You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

    Feature Command Description
    Code Review /gemini review Performs a code review for the current pull request in its current state.
    Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
    Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
    Help /gemini help Displays a list of available commands.

    Customization

    To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

    Limitations & Feedback

    Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

    You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

    Footnotes

    1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

    @qodo-code-review
    Copy link
    Contributor

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ No major issues detected

    @qodo-code-review
    Copy link
    Contributor

    PR Code Suggestions ✨

    No code suggestions found for the PR.

    Copy link
    Contributor

    @gemini-code-assist gemini-code-assist bot left a comment

    Choose a reason for hiding this comment

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

    Code Review

    This pull request consistently adds a final newline character to a large number of files across various types (JavaScript, Markdown, Handlebars, configuration files). This is a welcome change that improves consistency and adheres to common best practices for text files, which can prevent issues with some development tools and version control systems.

    The changes in each file appear to be correctly implemented, simply ensuring the file ends with a newline where it was previously missing.

    I've noted the comment in your PR description: npm test (fails: Missing required Supabase environment variables). While this test failure is likely unrelated to the newline changes in this PR, it's an important issue for the overall health of the project that the team should be aware of and address.

    Overall, this is a good housekeeping PR that improves the codebase's consistency. Well done!

    Summary of Findings

    • Consistent End-of-File Newlines: The pull request successfully adds missing newline characters at the end of numerous files. This is a good practice for maintainability and tool compatibility.
    • Scope of Changes: The changes cover JavaScript files, server-side files, Handlebars templates, Markdown documents, and root configuration files, aligning with the PR's goal of ensuring newlines in server/, public/js/, and other root files.

    Merge Readiness

    The code changes in this pull request are straightforward and correctly implement the addition of newlines at the end of files. These changes improve code consistency and are beneficial. Based on the review of the diffs, the PR appears ready for merging from a code quality perspective regarding the changes made. However, as a language model, I am not authorized to approve pull requests. Please ensure any failing tests (as mentioned in the PR description regarding Supabase environment variables) are understood and addressed as part of your team's process before merging.

    Copy link
    Contributor

    @sourcery-ai sourcery-ai bot left a comment

    Choose a reason for hiding this comment

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

    Hey @numbpill3d - I've reviewed your changes and they look great!

    Here's what I looked at during the review
    • 🟢 General issues: all looks good
    • 🟢 Security: all looks good
    • 🟢 Testing: all looks good
    • 🟢 Complexity: all looks good
    • 🟢 Documentation: all looks good

    Sourcery is free for open source - if you like our reviews please consider sharing them ✨
    Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

    .eslintrc.js Outdated
    Comment on lines 73 to 77
    }
    },
    ],
    };
    };
    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    The configuration block for test files ends abruptly at line 74 with no additional rules specified. While this may be intentional, it's often beneficial to explicitly define or comment on the rule set for clarity and maintainability. Consider adding more specific rules or a comment explaining the choice of minimal rules for test files.

    Additionally, ensure that the array and object closures on lines 75-77 are correctly formatted to prevent any potential syntax errors. This is crucial for maintaining the integrity of the ESLint configuration.

    Comment on lines 320 to 324
    }

    // Start random glitches
    setTimeout(addRandomGlitch, 5000);
    setTimeout(addRandomGlitch, 5000);
    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    The recursive use of setTimeout in addRandomGlitch function could lead to performance issues, especially if the page is left open for a long time or if the user navigates away and returns, potentially causing multiple instances to run. Consider implementing a more controlled loop using requestAnimationFrame or managing the state of the timeouts to prevent unnecessary resource usage.

    Additionally, the use of magic numbers (5000 and the random time calculation) directly in the code reduces maintainability. Define these values as constants or in a configuration object to make the code cleaner and easier to adjust.

    Comment on lines 140 to 143
    console.log("%c" + lainQuotes[Math.floor(Math.random() * lainQuotes.length)],
    "color: #00ff00; background: #0f0f0f; padding: 10px; font-family: monospace; font-size: 14px;");
    })();
    })();
    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    The use of console.log for outputting styled text in the console is creative, but it should be considered whether this is necessary in a production environment. Console outputs can be viewed by users and could potentially expose sensitive information or be used inappropriately. Additionally, there is no error handling for the case where lainQuotes might be undefined or empty, which would cause the script to throw an error when trying to access an index of it.

    Recommendation:

    • Ensure that logging to the console is appropriate for the use case and consider removing or guarding it with a development mode check.
    • Add error handling to check the existence and non-emptiness of the lainQuotes array before attempting to access its elements.

    Comment on lines 236 to 240
    20%, 40%, 60%, 80% { transform: translateX(5px); }
    }
    `;
    document.head.appendChild(style);
    document.head.appendChild(style);
    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    The current implementation directly manipulates the DOM to add CSS styles, which can lead to performance issues if used extensively and makes the code harder to maintain. Consider using a separate CSS file for styles or leveraging CSS-in-JS libraries if dynamic styling is necessary. This approach will not only improve performance by reducing DOM manipulations but also help in maintaining a clear separation between styling and business logic.

    Comment on lines 120 to 121
    this.style.boxShadow = '';
    });
    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    Direct manipulation of styles in JavaScript, as seen here with transform and boxShadow, can lead to performance issues and makes the code harder to maintain. Consider using CSS for styling and transitions. For instance, define a CSS class with the desired styles and use JavaScript to add or remove this class based on user interactions. This approach not only improves performance by offloading rendering to the CSS engine but also enhances maintainability by keeping style definitions within CSS.

    Example:

    .register-button-hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3), 0 0 10px rgba(0, 255, 0, 0.3);
    }
    registerButton.addEventListener('mouseover', function() {
        this.classList.add('register-button-hover');
    });
    registerButton.addEventListener('mouseout', function() {
        this.classList.remove('register-button-hover');
    });

    Comment on lines 228 to 232

    if (seconds < 10) return 'just now';
    return Math.floor(seconds) + ' seconds ago';
    }
    }
    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    The timeAgo function lacks error handling for invalid date inputs. If an invalid or non-parseable date string is passed to the function, it could result in runtime errors or incorrect calculations.

    Recommendation:
    Add validation at the beginning of the timeAgo function to check if date is a valid date object or can be successfully parsed by new Date(date). If not, return a default error message or handle the error appropriately.

    });

    console.log(`Cleared ${collectionKeys.length} collection cache entries`);
    }
    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    The clearCache method could potentially lead to performance issues if the number of cache keys is large. Iterating through all keys and filtering them can be inefficient, especially if this method is called frequently. Consider optimizing this process by maintaining a dedicated list or pattern for collection-related keys, or by using more efficient cache querying methods if supported by the caching technology in use.

    });

    console.log(`Cleared ${collectionKeys.length} collection cache entries`);
    }
    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    The method lacks error handling for potential failures in interacting with the cache, such as connection issues or permissions errors. This could lead to silent failures where the cache is not properly cleared, yet no error is reported. Enhancing error handling by catching and logging exceptions or errors during the cache deletion process would improve the robustness and reliability of the cache management system.

    Comment on lines 832 to 836
    }
    };

    module.exports = ScrapyardItem;
    module.exports = ScrapyardItem;
    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    While the export statement itself is correctly implemented, the ScrapyardItem class appears to handle multiple responsibilities, which might lead to challenges in maintainability as the application grows. Consider refactoring the class into smaller, more focused classes that each handle a specific aspect of the system. This approach would enhance modularity and adherence to the single responsibility principle, making the codebase easier to manage and extend.

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    2 participants