ffmt 0.3.0__tar.gz → 0.3.1__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.
- {ffmt-0.3.0 → ffmt-0.3.1}/.github/workflows/ci.yml +1 -1
- {ffmt-0.3.0 → ffmt-0.3.1}/Cargo.lock +1 -1
- {ffmt-0.3.0 → ffmt-0.3.1}/Cargo.toml +1 -1
- {ffmt-0.3.0 → ffmt-0.3.1}/PKG-INFO +2 -2
- {ffmt-0.3.0 → ffmt-0.3.1}/README.md +1 -1
- {ffmt-0.3.0 → ffmt-0.3.1}/pyproject.toml +1 -1
- {ffmt-0.3.0 → ffmt-0.3.1}/src/formatter.rs +33 -0
- {ffmt-0.3.0 → ffmt-0.3.1}/tests/fixtures/simple.expected.fpp +2 -0
- {ffmt-0.3.0 → ffmt-0.3.1}/.github/workflows/release.yml +0 -0
- {ffmt-0.3.0 → ffmt-0.3.1}/.github/workflows/update-readme-version.yml +0 -0
- {ffmt-0.3.0 → ffmt-0.3.1}/.gitignore +0 -0
- {ffmt-0.3.0 → ffmt-0.3.1}/.markdownlint.json +0 -0
- {ffmt-0.3.0 → ffmt-0.3.1}/.pre-commit-hooks.yaml +0 -0
- {ffmt-0.3.0 → ffmt-0.3.1}/.readthedocs.yml +0 -0
- {ffmt-0.3.0 → ffmt-0.3.1}/LICENSE +0 -0
- {ffmt-0.3.0 → ffmt-0.3.1}/action.yml +0 -0
- {ffmt-0.3.0 → ffmt-0.3.1}/docs/ci.md +0 -0
- {ffmt-0.3.0 → ffmt-0.3.1}/docs/configuration.md +0 -0
- {ffmt-0.3.0 → ffmt-0.3.1}/docs/editors.md +0 -0
- {ffmt-0.3.0 → ffmt-0.3.1}/docs/getting-started.md +0 -0
- {ffmt-0.3.0 → ffmt-0.3.1}/docs/index.md +0 -0
- {ffmt-0.3.0 → ffmt-0.3.1}/docs/requirements.txt +0 -0
- {ffmt-0.3.0 → ffmt-0.3.1}/mkdocs.yml +0 -0
- {ffmt-0.3.0 → ffmt-0.3.1}/src/align.rs +0 -0
- {ffmt-0.3.0 → ffmt-0.3.1}/src/case_norm.rs +0 -0
- {ffmt-0.3.0 → ffmt-0.3.1}/src/classifier.rs +0 -0
- {ffmt-0.3.0 → ffmt-0.3.1}/src/cli.rs +0 -0
- {ffmt-0.3.0 → ffmt-0.3.1}/src/config.rs +0 -0
- {ffmt-0.3.0 → ffmt-0.3.1}/src/keyword_norm.rs +0 -0
- {ffmt-0.3.0 → ffmt-0.3.1}/src/lib.rs +0 -0
- {ffmt-0.3.0 → ffmt-0.3.1}/src/lsp.rs +0 -0
- {ffmt-0.3.0 → ffmt-0.3.1}/src/main.rs +0 -0
- {ffmt-0.3.0 → ffmt-0.3.1}/src/reader.rs +0 -0
- {ffmt-0.3.0 → ffmt-0.3.1}/src/scope.rs +0 -0
- {ffmt-0.3.0 → ffmt-0.3.1}/src/unicode.rs +0 -0
- {ffmt-0.3.0 → ffmt-0.3.1}/src/whitespace.rs +0 -0
- {ffmt-0.3.0 → ffmt-0.3.1}/tests/case_norm.rs +0 -0
- {ffmt-0.3.0 → ffmt-0.3.1}/tests/classifier.rs +0 -0
- {ffmt-0.3.0 → ffmt-0.3.1}/tests/config_integration.rs +0 -0
- {ffmt-0.3.0 → ffmt-0.3.1}/tests/fixtures/blank_lines.expected.fpp +0 -0
- {ffmt-0.3.0 → ffmt-0.3.1}/tests/fixtures/blank_lines.input.fpp +0 -0
- {ffmt-0.3.0 → ffmt-0.3.1}/tests/fixtures/call_block.expected.fpp +0 -0
- {ffmt-0.3.0 → ffmt-0.3.1}/tests/fixtures/call_block.input.fpp +0 -0
- {ffmt-0.3.0 → ffmt-0.3.1}/tests/fixtures/directives.expected.fpp +0 -0
- {ffmt-0.3.0 → ffmt-0.3.1}/tests/fixtures/directives.input.fpp +0 -0
- {ffmt-0.3.0 → ffmt-0.3.1}/tests/fixtures/doxygen_spacing.expected.fpp +0 -0
- {ffmt-0.3.0 → ffmt-0.3.1}/tests/fixtures/doxygen_spacing.input.fpp +0 -0
- {ffmt-0.3.0 → ffmt-0.3.1}/tests/fixtures/fypp.expected.fpp +0 -0
- {ffmt-0.3.0 → ffmt-0.3.1}/tests/fixtures/fypp.input.fpp +0 -0
- {ffmt-0.3.0 → ffmt-0.3.1}/tests/fixtures/simple.input.fpp +0 -0
- {ffmt-0.3.0 → ffmt-0.3.1}/tests/integration.rs +0 -0
- {ffmt-0.3.0 → ffmt-0.3.1}/tests/reader.rs +0 -0
- {ffmt-0.3.0 → ffmt-0.3.1}/tests/scope.rs +0 -0
- {ffmt-0.3.0 → ffmt-0.3.1}/tests/whitespace.rs +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ffmt
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.1
|
|
4
4
|
Classifier: Development Status :: 4 - Beta
|
|
5
5
|
Classifier: Intended Audience :: Developers
|
|
6
6
|
Classifier: Intended Audience :: Science/Research
|
|
@@ -88,7 +88,7 @@ multdiv = false
|
|
|
88
88
|
# pre-commit
|
|
89
89
|
repos:
|
|
90
90
|
- repo: https://github.com/sbryngelson/ffmt
|
|
91
|
-
rev: v0.
|
|
91
|
+
rev: v0.3.0
|
|
92
92
|
hooks:
|
|
93
93
|
- id: ffmt
|
|
94
94
|
```
|
|
@@ -517,6 +517,9 @@ pub fn format_with_config(source: &str, config: &Config, range: Option<(usize, u
|
|
|
517
517
|
output_lines = apply(output_lines, &|lines| reformat_use_statements(lines, iw));
|
|
518
518
|
}
|
|
519
519
|
|
|
520
|
+
// Ensure blank line before and after `implicit none`
|
|
521
|
+
output_lines = apply(output_lines, &ensure_implicit_none_spacing);
|
|
522
|
+
|
|
520
523
|
// Remove blank lines immediately before block closers/continuations
|
|
521
524
|
output_lines = apply(output_lines, &remove_blanks_before_closers);
|
|
522
525
|
|
|
@@ -1182,6 +1185,36 @@ fn compact_use_statements(lines: &[String]) -> Vec<String> {
|
|
|
1182
1185
|
result
|
|
1183
1186
|
}
|
|
1184
1187
|
|
|
1188
|
+
/// Ensure one blank line before and after `implicit none`.
|
|
1189
|
+
/// The blank line before separates it from `use` statements.
|
|
1190
|
+
/// The blank line after separates it from declarations.
|
|
1191
|
+
fn ensure_implicit_none_spacing(lines: &[String]) -> Vec<String> {
|
|
1192
|
+
let mut result = Vec::with_capacity(lines.len() + 4);
|
|
1193
|
+
for (i, line) in lines.iter().enumerate() {
|
|
1194
|
+
let trimmed = line.trim().to_ascii_lowercase();
|
|
1195
|
+
if trimmed == "implicit none" {
|
|
1196
|
+
// Ensure blank line before (unless at start or already blank)
|
|
1197
|
+
if i > 0 {
|
|
1198
|
+
let prev = result
|
|
1199
|
+
.last()
|
|
1200
|
+
.map(|s: &String| s.trim().is_empty())
|
|
1201
|
+
.unwrap_or(true);
|
|
1202
|
+
if !prev {
|
|
1203
|
+
result.push(String::new());
|
|
1204
|
+
}
|
|
1205
|
+
}
|
|
1206
|
+
result.push(line.clone());
|
|
1207
|
+
// Ensure blank line after (unless next is blank or end)
|
|
1208
|
+
if i + 1 < lines.len() && !lines[i + 1].trim().is_empty() {
|
|
1209
|
+
result.push(String::new());
|
|
1210
|
+
}
|
|
1211
|
+
} else {
|
|
1212
|
+
result.push(line.clone());
|
|
1213
|
+
}
|
|
1214
|
+
}
|
|
1215
|
+
result
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1185
1218
|
/// Remove blank lines immediately before block closers/continuations
|
|
1186
1219
|
/// and immediately after block openers.
|
|
1187
1220
|
fn remove_blanks_before_closers(lines: &[String]) -> Vec<String> {
|
|
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
|
|
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
|
|
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
|
|
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
|