FEM Python coding standard
Moderator: bernd
Forum rules
and Helpful information for the FEM forum
and Helpful information for the FEM forum
Re: Python coding standard
cool, I need to get in all this documentation possibilities. In the regard off your commits. Since they are all FEM snd they all do the same, I would squash them into one commit.
bernd
bernd
Re: Python coding standard
cool, I need to get in all this documentation possibilities. In the regard off your commits. Since they are all FEM snd they all do the same, I would squash them into one commit.
bernd
PS: I could squash them and add it to my FEM dev branch I'm gone make a PullRequest soon hopefully. Means less work for yorik or werner
bernd
PS: I could squash them and add it to my FEM dev branch I'm gone make a PullRequest soon hopefully. Means less work for yorik or werner
Re: Python coding standard
Yea.. that would be great Thanks!bernd wrote:cool, I need to get in all this documentation possibilities. In the regard off your commits. Since they are all FEM snd they all do the same, I would squash them into one commit.
bernd
PS: I could squash them and add it to my FEM dev branch I'm gone make a PullRequest soon hopefully. Means less work for yorik or werner
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Re: Python coding standard
https://github.com/berndhahnebach/FreeC ... its/femdevKunda1 wrote:Yea.. that would be great Thanks!bernd wrote:cool, I need to get in all this documentation possibilities. In the regard off your commits. Since they are all FEM snd they all do the same, I would squash them into one commit.
bernd
PS: I could squash them and add it to my FEM dev branch I'm gone make a PullRequest soon hopefully. Means less work for yorik or werner
https://github.com/berndhahnebach/FreeC ... 1ba697f475
Re: FEM Python coding standard
Maybe adding codespell in to the workflow ?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Re: FEM Python coding standard
why do we add these huge list of words to codespell ?
Code: Select all
aci,aline,alledges,als,ang,beginn,behaviour,bloaded,calculater,cancelled,cancelling,cas,cascade,centimetre,childs,colour,colours,currenty,doubleclick,dum,eiter,elemente,feld,freez,iff,indicies,initialisation,initialise,initialised,initialises,initialisiert,kilometre,lod,mantatory,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oder,ot,pres,programm,que,recurrance,rougly,seperator,serie,sinc,strack,substraction,te,thist,thru,tread,vertexes,uint,unter,whitespaces -S *.ts,*.po src/Mod/Fem
Re: FEM Python coding standard
Those are ignored words that if not added to that list would prompt you to correct them. There are even scenarios when legit typos are added, say a developer in a project wrote a piece of code with functions that have misspellings in them and now because of backward compatibility they don't want to break the API or issue an API modification. The easier scenarios is just to agree to ignore the typo.
Code: Select all
-L WORDS, --ignore-words-list WORDS
Comma separated list of words to be ignored by
codespell. Words are case sensitive based on how they
are written in the dictionary file
codespell -i 3 -w -S <list of directories to ignore> -L <list of words to ignore>
- -I flag means 'interactive' and codespell will prompt you everytime it reaches a typo. Would you like to fix it (y/n)? and if there are multiple choice options - which one would you prefer to chose?
The number 3 indicates the level of interactivity:Code: Select all
-i INTERACTIVE, --interactive INTERACTIVE Set interactive mode when writing changes. 0: no interactivity. 1: ask for confirmation. 2 ask user to choose one fix when more than one is available. 3: both 1 and 2
- -w flag indicates to go ahead and write the change you're requesting to make (without this is like running a 'Dry Run' of codespell which shows you what it would fix but doesn't actually make changes to the disk)
- -S flag takes a comma separated list of directories for ex. ./.git,*.po,*.ts,./ChangeLog.txt,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/CXX,./src/zipios++,./src/Base/swig*,./src/Mod/Robot/App/kdl_cp,./src/Mod/Import/App/SCL,./src/WindowsInstaller
Important notes; do not end any of they directory paths with a slash because codespell will ignore it; you can use wild cards (at least asterisks), only a comma separates one directory from another (a whitespace after a comma will not be recognized) - -L flag takes a comma separated list of ignored words
codespell <variouscodespell flags> <1st directory to search> <2nd directory to search> <nth directory to search>
codespell -q 2./src/Mod/Fem ./src/Mod/Material
note: -q <number> suppresses codespell output in specific cases (I like to use level 2 which suppresses binary files that codespell will say it has encountered)
Edit:
The most up to date codespell list of flag for FreeCAD is:
Code: Select all
codespell -q 2 -L aci,ake,aline,alle,alledges,alocation,als,ang,anid,ba,beginn,behaviour,bloaded,byteorder,calculater,cancelled,cancelling,cas,cascade,centimetre,childs,colour,colours,commen,currenty,dof,doubleclick,dum,eiter,elemente,feld,freez,hist,iff,indicies,initialisation,initialise,initialised,initialises,initialisiert,ist,kilometre,lod,mantatory,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oder,ot,pard,pres,programm,que,recurrance,rougly,seperator,serie,sinc,strack,substraction,te,thist,thru,tread,uint,unter,vertexes,wallthickness,whitespaces -S ./.git,*.po,*.ts,./ChangeLog.txt,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/CXX,./src/zipios++,./src/Base/swig*,./src/Mod/Robot/App/kdl_cp,./src/Mod/Import/App/SCL,./src/WindowsInstaller,./src/Doc/FreeCAD.uml
Make sure you using the development version of codespell which has it's dictionary updated fairly often. If you don't want to run pip and install the development version you can use
Code: Select all
wget https://raw.githubusercontent.com/codespell-project/codespell/master/codespell_lib/data/dictionary.txt
codespell -D <path/to/dictionary.txt>
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs