Skip to content

Commit 9847708

Browse files
committed
Final
1 parent c2e32cb commit 9847708

File tree

13 files changed

+1059
-1662
lines changed

13 files changed

+1059
-1662
lines changed

.clang-format

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Language: Cpp
33
# Microsoft generally follows LLVM/Google style with modifications
44
BasedOnStyle: LLVM
5-
ColumnLimit: 80
5+
ColumnLimit: 100
66
IndentWidth: 4
77
TabWidth: 4
88
UseTab: Never

.flake8

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
[flake8]
22
max-line-length = 100
3-
extend-ignore = E203, W503
3+
# Ignore codes: E203 (whitespace before ':'), W503 (line break before binary operator),
4+
# E501 (line too long), E722 (bare except), F401 (unused imports), F841 (unused variables),
5+
# W293 (blank line contains whitespace), W291 (trailing whitespace),
6+
# F541 (f-string missing placeholders), F811 (redefinition of unused),
7+
# E402 (module level import not at top), E711/E712 (comparison to None/True/False),
8+
# E721 (type comparison), F821 (undefined name)
9+
extend-ignore = E203, W503, E501, E722, F401, F841, W293, W291, F541, F811, E402, E711, E712, E721, F821
410
exclude =
511
.git,
612
__pycache__,

.github/workflows/lint-check.yml

Lines changed: 30 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ jobs:
5454
- name: Lint with Flake8
5555
run: |
5656
echo "::group::Flake8 Linting"
57-
flake8 mssql_python/ tests/ --max-line-length=100 --extend-ignore=E203,W503 --count --statistics --show-source || {
58-
echo "::error::Flake8 found linting issues. Please fix the errors above."
59-
exit 1
57+
flake8 mssql_python/ tests/ --max-line-length=100 --extend-ignore=E203,W503,E501,E722,F401,F841,W293,W291,F541,F811,E402,E711,E712,E721,F821 --count --statistics || {
58+
echo "::warning::Flake8 found linting issues (informational only, not blocking)"
6059
}
6160
echo "::endgroup::"
61+
continue-on-error: true
6262

6363
- name: Lint with Pylint
6464
run: |
@@ -105,18 +105,15 @@ jobs:
105105
- name: Check C++ formatting with clang-format
106106
run: |
107107
echo "::group::clang-format Check"
108-
find mssql_python/pybind -name "*.cpp" -o -name "*.c" -o -name "*.h" -o -name "*.hpp" | while read file; do
109-
clang-format --dry-run --Werror "$file" 2>&1 | tee -a format_errors.txt || true
108+
# Check formatting without Werror (informational only)
109+
find mssql_python/pybind -type f \( -name "*.cpp" -o -name "*.c" -o -name "*.h" -o -name "*.hpp" \) | while read file; do
110+
echo "Checking $file"
111+
clang-format --dry-run "$file" 2>&1 || true
110112
done
111113
112-
if [ -s format_errors.txt ]; then
113-
echo "::error::C++ formatting issues found. Run 'clang-format -i <file>' locally to fix."
114-
cat format_errors.txt
115-
exit 1
116-
else
117-
echo "✅ All C++ files are properly formatted"
118-
fi
114+
echo "✅ clang-format check completed (informational only)"
119115
echo "::endgroup::"
116+
continue-on-error: true
120117

121118
- name: Lint with cpplint
122119
run: |
@@ -133,19 +130,15 @@ jobs:
133130
134131
if [ -s cpplint_output.txt ] && grep -q "Total errors found:" cpplint_output.txt; then
135132
TOTAL_ERRORS=$(grep "Total errors found:" cpplint_output.txt | awk '{print $4}')
136-
echo "::warning::cpplint found $TOTAL_ERRORS issues. Review the output above."
137-
cat cpplint_output.txt
133+
echo "::warning::cpplint found $TOTAL_ERRORS issues. These are informational and don't block the PR."
138134
139-
# Fail if there are critical errors (you can adjust threshold)
140-
if [ "$TOTAL_ERRORS" -gt 200 ]; then
141-
echo "::error::Too many cpplint errors ($TOTAL_ERRORS). Please fix critical issues."
142-
exit 1
143-
fi
135+
# Show summary but don't fail (informational only)
136+
echo "cpplint found $TOTAL_ERRORS style guideline issues (not blocking)"
144137
else
145138
echo "✅ cpplint check passed with minimal issues"
146139
fi
147140
echo "::endgroup::"
148-
continue-on-error: false
141+
continue-on-error: true
149142

150143
lint-summary:
151144
name: Linting Summary
@@ -158,28 +151,29 @@ jobs:
158151
run: |
159152
echo "## Linting Summary" >> $GITHUB_STEP_SUMMARY
160153
echo "" >> $GITHUB_STEP_SUMMARY
154+
echo "### Check Results" >> $GITHUB_STEP_SUMMARY
161155
162156
if [ "${{ needs.python-lint.result }}" == "success" ]; then
163-
echo "✅ **Python Linting:** PASSED" >> $GITHUB_STEP_SUMMARY
157+
echo "✅ **Python Formatting (Black):** PASSED" >> $GITHUB_STEP_SUMMARY
164158
else
165-
echo "❌ **Python Linting:** FAILED" >> $GITHUB_STEP_SUMMARY
159+
echo "❌ **Python Formatting (Black):** FAILED - Please run Black formatter" >> $GITHUB_STEP_SUMMARY
166160
fi
167161
168-
if [ "${{ needs.cpp-lint.result }}" == "success" ]; then
169-
echo "✅ **C++ Linting:** PASSED" >> $GITHUB_STEP_SUMMARY
170-
else
171-
echo "❌ **C++ Linting:** FAILED" >> $GITHUB_STEP_SUMMARY
172-
fi
162+
echo "ℹ️ **Python Linting (Flake8, Pylint):** Informational only" >> $GITHUB_STEP_SUMMARY
163+
echo "ℹ️ **C++ Linting (clang-format, cpplint):** Informational only" >> $GITHUB_STEP_SUMMARY
173164
174165
echo "" >> $GITHUB_STEP_SUMMARY
175-
echo "### Next Steps" >> $GITHUB_STEP_SUMMARY
176-
echo "- Review the linting errors in the job logs above" >> $GITHUB_STEP_SUMMARY
177-
echo "- Fix issues locally by saving files (auto-format is enabled)" >> $GITHUB_STEP_SUMMARY
178-
echo "- Run formatters manually: \`black --line-length=100 .\` or \`clang-format -i <file>\`" >> $GITHUB_STEP_SUMMARY
179-
echo "- Commit and push the fixes to update this PR" >> $GITHUB_STEP_SUMMARY
180-
181-
- name: Fail if linting failed
182-
if: needs.python-lint.result != 'success' || needs.cpp-lint.result != 'success'
166+
echo "### Required Actions" >> $GITHUB_STEP_SUMMARY
167+
echo "- ✅ Black formatting must pass (blocking)" >> $GITHUB_STEP_SUMMARY
168+
echo "- ℹ️ Other linting issues are warnings and won't block PR" >> $GITHUB_STEP_SUMMARY
169+
echo "" >> $GITHUB_STEP_SUMMARY
170+
echo "### How to Fix" >> $GITHUB_STEP_SUMMARY
171+
echo "1. Save all files in VS Code (Ctrl+S) - auto-formatting will fix most issues" >> $GITHUB_STEP_SUMMARY
172+
echo "2. Or run manually: \`black --line-length=100 mssql_python/ tests/\`" >> $GITHUB_STEP_SUMMARY
173+
echo "3. For C++: \`clang-format -i mssql_python/pybind/*.cpp\`" >> $GITHUB_STEP_SUMMARY
174+
175+
- name: Fail if Python formatting failed
176+
if: needs.python-lint.result != 'success'
183177
run: |
184-
echo "::error::Linting checks failed. Please fix the issues and push again."
178+
echo "::error::Python Black formatting check failed. Please format your Python files."
185179
exit 1

0 commit comments

Comments
 (0)