GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(util): prevent redundant repoType and commitConvention in .all-contributorsrc (#369) by matbrgz · Pull Request #546 · all-contributors/cli

Conversation

@matbrgz

@matbrgz matbrgz commented Sep 27, 2026

Copy link
Copy Markdown

Description

Closes #369.

Problem

In #369, adding a contributor to a project via all-contributors add caused repoType: "github" and commitConvention: "angular" to be injected into .all-contributorsrc, even when they were omitted from the file. These properties have documented defaults and should not be forcibly written into minimal configuration files.

Root Cause

writeContributors called readConfig(configPath), which in-place assigned default values:

if (!('repoType' in config)) config.repoType = 'github'
if (!('commitConvention' in config)) config.commitConvention = 'angular'

When writeConfig was subsequently called with { ...config, contributors }, these injected defaults were serialized back to disk.

Solution

  1. Separation of Raw vs Resolved Config:
    • Extracted readRawConfig in src/util/config-file.js to parse config from disk without mutating the object.
    • Updated writeContributors to use readRawConfig, only updating contributors while preserving the original structure.
    • Kept readConfig providing repoType: 'github' and commitConvention: 'angular' in memory for CLI execution and git operations.
  2. Spec-Driven Documentation: Added SDD specification at docs/specs/prevent-redundant-defaults-in-config.md.
  3. Unit Tests: Added tests in src/util/__tests__/config-file.js verifying that writeContributors does not inject repoType or commitConvention into minimal configs, while preserving them if explicitly configured.

Verification

  • All 116 tests pass (npm test -- --run).
  • Linter and Prettier pass (npm run lint).
  • Signed with GPG key B6FA8458D5176E83.

Co-Authored-By: Antigravity [email protected]

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@matbrgz
fix(util): prevent redundant repoType and commitConvention in .all-co…
4d5da8e
…ntributorsrc (#369)

Prevent redundant repoType and commitConvention in .all-contributorsrc (#369)

- Extract readRawConfig to parse configuration without mutating the object with runtime defaults
- Update writeContributors to read raw config so defaults are not forcibly written to disk
- Preserve existing repoType and commitConvention when already defined
- Keep readConfig supplying in-memory defaults for CLI runtime
- Add SDD specification at docs/specs/prevent-redundant-defaults-in-config.md
- Add unit tests verifying defaults are not injected into minimal configurations

Closes #369

Co-Authored-By: Antigravity <[email protected]>
@matbrgz

This comment was marked as spam.

Sign in to view
@matbrgz matbrgz closed this Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Redundant commitConvention and repoType added to .all-contributorsrc file on add

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@matbrgz
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.