Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix github-linguist statistics #547

Merged
merged 2 commits into from
Dec 15, 2020
Merged

Conversation

marcus7070
Copy link
Member

CQ's current language statistics:
screenshot2020-12-14-144611

These changes will make it look like:
screenshot2020-12-15-143743

See my fork to see it in action.

The problem was a single Jupyter Notebook, github-linguist naively counts every line of code in that 5MB file. Moving it to the examples directory means github-linguist now classes it as documentation (not core code) and ignores it.

I also added a .gitattributes, which tells git to treat tests/testdata/* and *.ipynb as un-diff-able and not to change the line endings on those files. Doesn't fix any issue in particular, just seems like good practise.

Tell git that the test/testdata/ files and Jupyter Notebooks are binary
files, ie. do not display diffs and do not touch line endings in those
files.
Now github-linguist will classify it as documentation, and the massive
line count in that file will stop skewing the language statistics for
CadQuery on Github.
@marcus7070
Copy link
Member Author

If anyone is interested, here are the files github-linguist considers when calculating CQ's language statistics:

marcus> github-linguist --breakdown
99.97%  Python
0.02%   Shell
0.01%   Batchfile

Shell:
build-docs.sh
conda_build.sh

Python:
cadquery/__init__.py
cadquery/assembly.py
cadquery/contrib/__init__.py
cadquery/cq.py
cadquery/cq_directive.py
cadquery/cqgi.py
cadquery/occ_impl/assembly.py
cadquery/occ_impl/exporters/__init__.py
cadquery/occ_impl/exporters/amf.py
cadquery/occ_impl/exporters/assembly.py
cadquery/occ_impl/exporters/dxf.py
cadquery/occ_impl/exporters/json.py
cadquery/occ_impl/exporters/svg.py
cadquery/occ_impl/exporters/utils.py
cadquery/occ_impl/geom.py
cadquery/occ_impl/importers.py
cadquery/occ_impl/jupyter_tools.py
cadquery/occ_impl/shapes.py
cadquery/occ_impl/solver.py
cadquery/plugins/__init__.py
cadquery/selectors.py
cadquery/units.py
cadquery/utils.py
setup.py
tests/__init__.py
tests/test_assembly.py
tests/test_cad_objects.py
tests/test_cadquery.py
tests/test_cqgi.py
tests/test_exporters.py
tests/test_importers.py
tests/test_jupyter.py
tests/test_selectors.py
tests/test_workplanes.py

Batchfile:
conda_build.bat

@codecov
Copy link

codecov bot commented Dec 15, 2020

Codecov Report

Merging #547 (9f4836c) into master (6a6e39f) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #547   +/-   ##
=======================================
  Coverage   94.18%   94.18%           
=======================================
  Files          29       29           
  Lines        6208     6208           
  Branches      663      663           
=======================================
  Hits         5847     5847           
  Misses        224      224           
  Partials      137      137           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6a6e39f...9f4836c. Read the comment docs.

@jmwright
Copy link
Member

@marcus7070 Thanks!

@adam-urbanczyk I think this is good to merge, do you agree?

@adam-urbanczyk
Copy link
Member

Yes, thanks @marcus7070 - merging.

@adam-urbanczyk adam-urbanczyk merged commit a576f1d into CadQuery:master Dec 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants