settingspec 0.1.1__tar.gz → 0.1.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. {settingspec-0.1.1 → settingspec-0.1.2}/Cargo.lock +1 -1
  2. {settingspec-0.1.1 → settingspec-0.1.2}/Cargo.toml +1 -1
  3. {settingspec-0.1.1 → settingspec-0.1.2}/PKG-INFO +1 -1
  4. {settingspec-0.1.1 → settingspec-0.1.2}/src/cli.rs +8 -8
  5. {settingspec-0.1.1 → settingspec-0.1.2}/src/model.rs +10 -8
  6. {settingspec-0.1.1 → settingspec-0.1.2}/LICENSE-APACHE +0 -0
  7. {settingspec-0.1.1 → settingspec-0.1.2}/LICENSE-MIT +0 -0
  8. {settingspec-0.1.1 → settingspec-0.1.2}/README.md +0 -0
  9. {settingspec-0.1.1 → settingspec-0.1.2}/pyproject.toml +0 -0
  10. {settingspec-0.1.1 → settingspec-0.1.2}/src/envfile.rs +0 -0
  11. {settingspec-0.1.1 → settingspec-0.1.2}/src/error.rs +0 -0
  12. {settingspec-0.1.1 → settingspec-0.1.2}/src/filter.rs +0 -0
  13. {settingspec-0.1.1 → settingspec-0.1.2}/src/generator/common.rs +0 -0
  14. {settingspec-0.1.1 → settingspec-0.1.2}/src/generator/env.rs +0 -0
  15. {settingspec-0.1.1 → settingspec-0.1.2}/src/generator/javascript.rs +0 -0
  16. {settingspec-0.1.1 → settingspec-0.1.2}/src/generator/json.rs +0 -0
  17. {settingspec-0.1.1 → settingspec-0.1.2}/src/generator/lua.rs +0 -0
  18. {settingspec-0.1.1 → settingspec-0.1.2}/src/generator/mod.rs +0 -0
  19. {settingspec-0.1.1 → settingspec-0.1.2}/src/generator/python.rs +0 -0
  20. {settingspec-0.1.1 → settingspec-0.1.2}/src/generator/toml.rs +0 -0
  21. {settingspec-0.1.1 → settingspec-0.1.2}/src/generator/tree.rs +0 -0
  22. {settingspec-0.1.1 → settingspec-0.1.2}/src/generator/typescript.rs +0 -0
  23. {settingspec-0.1.1 → settingspec-0.1.2}/src/generator/yaml.rs +0 -0
  24. {settingspec-0.1.1 → settingspec-0.1.2}/src/lib.rs +0 -0
  25. {settingspec-0.1.1 → settingspec-0.1.2}/src/main.rs +0 -0
  26. {settingspec-0.1.1 → settingspec-0.1.2}/src/parser.rs +0 -0
  27. {settingspec-0.1.1 → settingspec-0.1.2}/src/profile.rs +0 -0
  28. {settingspec-0.1.1 → settingspec-0.1.2}/src/resolver.rs +0 -0
@@ -564,7 +564,7 @@ dependencies = [
564
564
 
565
565
  [[package]]
566
566
  name = "settingspec"
567
- version = "0.1.1"
567
+ version = "0.1.2"
568
568
  dependencies = [
569
569
  "anyhow",
570
570
  "assert_cmd",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "settingspec"
3
- version = "0.1.1"
3
+ version = "0.1.2"
4
4
  edition = "2024"
5
5
  description = "One file for all environments, all languages, all submodules."
6
6
  readme = "README.md"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: settingspec
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: Implementation :: CPython
6
6
  Classifier: Programming Language :: Python :: Implementation :: PyPy
@@ -224,7 +224,7 @@ fn execute_run(ctx: &ExecutionContext, command_args: &[String]) -> Result<()> {
224
224
  Ok(())
225
225
  }
226
226
 
227
- pub fn write_export_file(path: &Path, content: &str, mode: u32) -> Result<()> {
227
+ pub fn write_export_file(path: &Path, content: &str, _mode: u32) -> Result<()> {
228
228
  if let Some(parent) = path.parent()
229
229
  && !parent.as_os_str().is_empty()
230
230
  {
@@ -236,7 +236,7 @@ pub fn write_export_file(path: &Path, content: &str, mode: u32) -> Result<()> {
236
236
  #[cfg(unix)]
237
237
  {
238
238
  use std::os::unix::fs::PermissionsExt;
239
- let perms = std::fs::Permissions::from_mode(mode);
239
+ let perms = std::fs::Permissions::from_mode(_mode);
240
240
  let _ = std::fs::set_permissions(path, perms);
241
241
  }
242
242
 
@@ -296,12 +296,12 @@ fn is_entry_in_gitignore(existing_content: &str, entry: &str) -> bool {
296
296
  }
297
297
  // In git, a pattern without '/' matches anywhere in the repository:
298
298
  // E.g. if .gitignore has "settings.toml", it matches "subdir/settings.toml".
299
- if !trimmed.starts_with('/') && !norm_line.contains('/') {
300
- if let Some((_, file_name)) = norm_entry.rsplit_once('/') {
301
- if file_name == norm_line {
302
- return true;
303
- }
304
- }
299
+ if !trimmed.starts_with('/')
300
+ && !norm_line.contains('/')
301
+ && let Some((_, file_name)) = norm_entry.rsplit_once('/')
302
+ && file_name == norm_line
303
+ {
304
+ return true;
305
305
  }
306
306
  }
307
307
  false
@@ -155,14 +155,16 @@ where
155
155
  D: Deserializer<'de>,
156
156
  {
157
157
  let val = i64::deserialize(deserializer)?;
158
- let mode_u32 = if val == 0x600 || val == 0o600 {
159
- 0o600
160
- } else if (0..=0o777).contains(&val) {
161
- val as u32
162
- } else {
163
- 0o600
164
- };
165
- Ok(mode_u32)
158
+ if (0..=0o777).contains(&val) {
159
+ return Ok(val as u32);
160
+ }
161
+ let hex = format!("{:x}", val);
162
+ if let Ok(octal) = u32::from_str_radix(&hex, 8)
163
+ && (0..=0o7777).contains(&octal)
164
+ {
165
+ return Ok(octal);
166
+ }
167
+ Ok(0o600)
166
168
  }
167
169
 
168
170
  /// A field that accepts either a boolean toggle or a string value in TOML.
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes