Skip to content

Commit e0b1bf1

Browse files
committed
refactor: standardize config file naming to use .toml extension
Unifies all configuration file naming to consistently use the .toml extension for better clarity and discoverability. Changes: - Rename .ccsync -> .ccsync.toml (project config) - Rename .ccsync.local -> .ccsync.local.toml (local overrides) - Update config discovery logic to search for new filenames - Update all documentation comments and README - Update .gitignore to reflect new naming convention This change makes it immediately clear that config files use TOML format and aligns with common conventions for configuration files.
1 parent 68b2482 commit e0b1bf1

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ target/
4949
# tasks/
5050

5151
# Local config overrides (user-specific, not committed)
52-
.ccsync.local
52+
.ccsync.local.toml
5353

5454
# Devenv
5555
.devenv*

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ Press **q** or **Ctrl+C** to cancel anytime.
104104

105105
## ⚙️ Configuration Files
106106

107-
Create a `.ccsync` file in your project to customize sync behavior:
107+
Create a `.ccsync.toml` file in your project to customize sync behavior:
108108

109109
```toml
110110
# Ignore certain files (gitignore-style patterns)
@@ -119,8 +119,8 @@ conflict_strategy = "newer"
119119

120120
**Config file locations** (in order of precedence):
121121
1. `--config <path>` - Custom config file via flag
122-
2. `.ccsync.local` - Project-local (gitignored, for personal settings)
123-
3. `.ccsync` - Project config (committed to repo)
122+
2. `.ccsync.local.toml` - Project-local (gitignored, for personal settings)
123+
3. `.ccsync.toml` - Project config (committed to repo)
124124
4. `~/.config/ccsync/config.toml` - Global config
125125

126126
**CLI flags always override config files.**

crates/ccsync-core/src/config/discovery.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ use crate::error::Result;
99
pub struct ConfigFiles {
1010
/// Config from CLI flag (highest precedence)
1111
pub cli: Option<PathBuf>,
12-
/// Project-local config (.ccsync.local)
12+
/// Project-local config (.ccsync.local.toml)
1313
pub local: Option<PathBuf>,
14-
/// Project config (.ccsync)
14+
/// Project config (.ccsync.toml)
1515
pub project: Option<PathBuf>,
1616
/// Global XDG config
1717
pub global: Option<PathBuf>,
@@ -53,8 +53,8 @@ impl ConfigDiscovery {
5353
None
5454
};
5555

56-
let local = Self::find_file(".ccsync.local");
57-
let project = Self::find_file(".ccsync");
56+
let local = Self::find_file(".ccsync.local.toml");
57+
let project = Self::find_file(".ccsync.toml");
5858
let global = Self::find_global_config();
5959

6060
Ok(ConfigFiles {

crates/ccsync-core/src/config/merge.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
//!
1010
//! Configs are loaded from lowest to highest precedence:
1111
//! 1. Global config (~/.config/ccsync/config.toml)
12-
//! 2. Project config (.ccsync)
13-
//! 3. Local config (.ccsync.local)
12+
//! 2. Project config (.ccsync.toml)
13+
//! 3. Local config (.ccsync.local.toml)
1414
//! 4. CLI config (--config flag)
1515
//!
1616
//! Higher precedence configs fully override boolean values from lower precedence configs.
@@ -44,8 +44,8 @@ impl ConfigMerger {
4444
///
4545
/// Precedence order (highest to lowest):
4646
/// 1. CLI config
47-
/// 2. .ccsync.local
48-
/// 3. .ccsync
47+
/// 2. .ccsync.local.toml
48+
/// 3. .ccsync.toml
4949
/// 4. Global config
5050
///
5151
/// # Errors

0 commit comments

Comments
 (0)