View Issue Details

IDProjectCategoryView StatusLast Update
0003206Project Tools & Websites[All Projects] Generalpublic2017-11-12 17:26
ReporterKunda1 Assigned ToKunda1  
PrioritylowSeverityfeatureReproducibilityN/A
Status assignedResolutionopen 
Product Version 
Target VersionFixed in Version 
Summary0003206: TravisCI to run code linting to report trailing whitespace/tabs + LF line endings
DescriptionRecently @wmayer expressed a way to remove trailing whitespaces and tabs in FC code. We could also think about avoiding more of them from being introduced in to source via testing when a PR is submitted.

TagsTravisCI, unit-test
FreeCAD Information

Relationships

related to 0003205 assignedKunda1 Project Tools & Websites TravisCI to check spelling of submitted Pull Requests to FC repo 
related to 0001352 new FreeCAD DOS line endings makes applying patches on Linux really hard 
child of 0003259 assigned Project Tools & Websites Buildbot framework 

Activities

berndhahnebach

2017-10-08 07:16

developer   ~0010262

Last edited: 2017-10-08 07:17

View 5 revisions

How did he do this?


AFAIK FEM is be free of trailing whitespaces and tabs. I remove them manually. For tabs I use:

grep -rl --exclude=\*.{qm,fcstd,png} $'\t' ./src/Mod/Fem/

Would be cool if we could include this in travis and step by step add any clean source directory of FreeCAD to it.

From my point it should be before any start of compiling on travis.

bernd

Kunda1

2017-10-09 19:27

administrator   ~0010274

Here's a tut on Howto Automatically fix PEP-8 issues using Travis-CI
Just can show us how to implement something in to travis

Kunda1

2017-10-14 18:41

administrator   ~0010297

Cause TravisCI to fail on any trailing whitespace
https://coderwall.com/p/h988xa/cause-travis-to-fail-on-trailing-whitespace
Add this to the script: section of .travis.yml
- "! git grep ' $' -- \\*.rb \\*.js \\*.other-file-types | grep -v -e 'FILE_TO_IGNORE' -e 'OTHER_FILE_TO_IGNORE"

Kunda1

2017-10-16 14:27

administrator   ~0010301

@wmayer what do you think would be a good outcome if a PR is found to have trailing whitespace? Should it kill the build process and report to the user where the whitespace is?

wmayer

2017-10-17 18:12

administrator   ~0010311

> what do you think would be a good outcome if a PR is found to have trailing whitespace?
Detecting a trailing whitespace would be good but it should not abort the build process.

Kunda1

2017-11-10 14:25

administrator   ~0010405

FFmpeg has a cool script that checks patches:
https://github.com/FFmpeg/FFmpeg/blob/master/tools/patcheck

Issue History

Date Modified Username Field Change
2017-10-01 12:29 Kunda1 New Issue
2017-10-01 12:29 Kunda1 Tag Attached: TravisCI
2017-10-01 13:44 Kunda1 Tag Attached: unit-test
2017-10-01 20:11 Kunda1 Relationship added related to 0003205
2017-10-01 20:39 Kunda1 Status new => assigned
2017-10-01 20:39 Kunda1 Assigned To => Kunda1
2017-10-08 07:16 berndhahnebach Note Added: 0010262
2017-10-08 07:17 berndhahnebach Note Edited: 0010262 View Revisions
2017-10-08 07:17 berndhahnebach Note Edited: 0010262 View Revisions
2017-10-08 07:17 berndhahnebach Note Edited: 0010262 View Revisions
2017-10-08 07:17 berndhahnebach Note Edited: 0010262 View Revisions
2017-10-09 19:27 Kunda1 Note Added: 0010274
2017-10-14 18:41 Kunda1 Note Added: 0010297
2017-10-16 14:27 Kunda1 Note Added: 0010301
2017-10-17 18:12 wmayer Note Added: 0010311
2017-10-19 13:10 Kunda1 Relationship added related to 0001352
2017-10-19 13:11 Kunda1 Summary TravisCI to run code linting to report trailing whitespace/tabs => TravisCI to run code linting to report trailing whitespace/tabs + LF line endings
2017-11-10 14:25 Kunda1 Note Added: 0010405
2017-11-12 17:26 Kunda1 Relationship added child of 0003259