@@ -91,43 +91,38 @@ jobs:
9191 - name : Find and validate Fluent files
9292 shell : bash
9393 run : |
94- ## Find and validate Fluent files with Mozilla Fluent Linter
9594
96- # Check if any .ftl files exist
97- fluent_files=$(find . -name "*.ftl" -type f 2>/dev/null || true)
95+ fluent_dirs=$(find . -name "*.ftl" -type f -exec dirname {} \; | sort | uniq 2>/dev/null || true)
9896
99- if [ -n "$fluent_files" ]; then
100- echo "Found Fluent files:"
101- echo "$fluent_files"
97+ if [ -n "$fluent_dirs" ]; then
98+ echo "Found Fluent directories:"
99+ echo "$fluent_dirs"
100+
101+ # Count total files for informational purposes
102+ total_files=$(find . -name "*.ftl" -type f | wc -l)
103+ echo "Total Fluent files: $total_files"
102104 else
103105 echo "::notice::No Fluent (.ftl) files found in the repository"
104106 exit 0
105107 fi
106108
107- # Use Mozilla Fluent Linter for comprehensive validation
108- echo "Running Mozilla Fluent Linter..."
109+ echo "Running Fluent Linter on directories..."
109110
110111 has_errors=false
111112
112- while IFS= read -r file ; do
113- echo "Checking $file with Mozilla Fluent Linter..."
113+ while IFS= read -r dir ; do
114+ echo "Checking directory $dir with Fluent Linter..."
114115
115- # Run fluent-linter on each file
116- if ! moz-fluent-lint "$file"; then
117- echo "::error file=$file::Fluent syntax errors found in $file"
118- has_errors=true
116+ if ! moz-fluent-lint --config .github/fluent_linter_config.yml "$dir"; then
117+ echo "::error::Fluent syntax errors found in $dir"
118+ exit 1
119119 else
120- echo "✓ Fluent syntax check passed for $file "
120+ echo "✓ Fluent syntax check passed for directory $dir "
121121 fi
122122
123- done <<< "$fluent_files"
124-
125- if [ "$has_errors" = true ]; then
126- echo "::error::Fluent linting failed - please fix syntax errors"
127- exit 1
128- fi
123+ done <<< "$fluent_dirs"
129124
130- echo "::notice::All Fluent files passed Mozilla Fluent Linter validation"
125+ echo "::notice::All Fluent directories passed Fluent Linter validation"
131126
132127 l10n_clap_error_localization :
133128 name : L10n/Clap Error Localization Test
0 commit comments