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

failing to use .sccignore #550

Closed
janpfeifer opened this issue Oct 29, 2024 · 4 comments
Closed

failing to use .sccignore #550

janpfeifer opened this issue Oct 29, 2024 · 4 comments

Comments

@janpfeifer
Copy link

Describe the bug
Follow up of #549 , but the issue now is that .sccignore is not processed.

Example: my project has all the .proto and generated code in a sub-directory internal/protos:

$ cat .sccignore
internal/protos
$ scc
───────────────────────────────────────────────────────────────────────────────
Language                 Files     Lines   Blanks  Comments     Code Complexity
───────────────────────────────────────────────────────────────────────────────
Go                          15      5339      553       827     3959        632
Protocol Buffers             3      1186      190       691      305          0
Jupyter                      2       512        0         0      512          0
Markdown                     2        20        7         0       13          0
License                      1       201       32         0      169          0
gitignore                    1        29        7        11       11          0
───────────────────────────────────────────────────────────────────────────────
Total                       24      7287      789      1529     4969        632
───────────────────────────────────────────────────────────────────────────────
Estimated Cost to Develop (organic) $145,437
Estimated Schedule Effort (organic) 6.610459 months
Estimated People Required (organic) 1.954619
───────────────────────────────────────────────────────────────────────────────
Processed 288291 bytes, 0.288 megabytes (SI)
───────────────────────────────────────────────────────────────────────────────

$ scc --by-file | grep internal/protos
~internal/protos/onnx-ml.pb.go      3208      345       522     2341        316
internal/protos/protos.go              4        1         2        1          0
~internal/protos/onnx-ml.proto       895      132       524      239          0
internal/protos/README.md             11        4         0        7          0

Expected behavior
The same it does with .ignore which is currently working:

$ mv .sccignore .ignore
$ cat .ignore 
internal/protos

$ scc
───────────────────────────────────────────────────────────────────────────────
Language                 Files     Lines   Blanks  Comments     Code Complexity
───────────────────────────────────────────────────────────────────────────────
Go                          11      1139      100       139      900        228
Jupyter                      2       512        0         0      512          0
License                      1       201       32         0      169          0
Markdown                     1         9        3         0        6          0
gitignore                    1        29        7        11       11          0
ignore                       1         1        0         0        1          0
───────────────────────────────────────────────────────────────────────────────
Total                       17      1891      142       150     1599        228
───────────────────────────────────────────────────────────────────────────────
Estimated Cost to Develop (organic) $44,221
Estimated Schedule Effort (organic) 4.204901 months
Estimated People Required (organic) 0.934321
───────────────────────────────────────────────────────────────────────────────
Processed 68864 bytes, 0.069 megabytes (SI)
───────────────────────────────────────────────────────────────────────────────

$ scc --by-file | grep internal/protos
# no output

Desktop (please complete the following information):

  • OS: Linux bitly 6.8.0-47-generic #47-Ubuntu SMP PREEMPT_DYNAMIC Fri Sep 27 21:40:26 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

  • SCC Version: current head, installed 5 minutes ago with go install github.com/boyter/scc@master

@janpfeifer janpfeifer changed the title .sccignore not used failing to use .sccignore Oct 29, 2024
@apocelipes
Copy link
Contributor

You should install scc with: go install github.com/boyter/scc/v3@master, not the go install github.com/boyter/scc@master.
image

github.com/boyter/scc@master gives you an ancient version of scc:
image

I tested the correct version of scc and the '.sccignore' works well to me.

I think the README should be updated, since we now only support Go1.22+.

@janpfeifer
Copy link
Author

Thank you @apocelipes

Yes, indeed the README was telling me to use the version I used:

image

Maybe worth a fix to the README ?

@apocelipes
Copy link
Contributor

My pleasure, I'm glad it helped.

Maybe worth a fix to the README ?

I've sent a PR to update this, you can take a look at #551.

@boyter
Copy link
Owner

boyter commented Oct 29, 2024

Sorry about the issue you encountered @janpfeifer but thanks to @apocelipes this should hopefully be resolved.

@boyter boyter closed this as completed Oct 29, 2024
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

No branches or pull requests

3 participants