Comments (8)
Thank for pointing at the remapping in this specific case I could add a vim tag to the bash files. I also ran a test with --remap-all that worked well (I ned to check the results a bit more).
I have symlinks in the directory structure, that completely broke scc I think as it never finished working.
from scc.
Ah ok.
So the way scc
works internally is to check the extension. If its a singular known file type it treats it as that. Where there are multiple it will inspect the first few thousand bytes counting keywords trying to identify the most likely type then count on that.
Where the filename itself matches, such as makefile
the above applies.
Where nothing matches the file is then checked for the presence of a #! operator.
So what I get from the above is you want to do a remap? This currently exists perhaps.
Have a look at the following options, which might do what you are expecting.
--remap-all
--remap-unknown
I suspect either of those should work if you are prepared to add a small comment on the top of your files. Although I understand this might not be ideal.
I don't know if any other option is a good idea in this case, at least without it being an opt-in to ensure that performance is not tanked.
from scc.
linux
here's how my directory structure looks lile
config/
└── ftl
├── bindings
├── commands -> etc/commands/ * link
├── etags -> etc/etags/ *link
├── etc
│ ├── bin
│ │ └── third_party
│ ├── bindings
│ │ └── lib
│ ├── commands
│ │ └── ftlrc_dir
│ ├── core
│ │ └── lib
│ │ ├── lock_preview
│ │ └── merge
│ ├── etags
│ ├── filters
│ ├── generators
│ └── viewers
├── filters -> etc/filters/ *link
├── generators -> etc/generators/ *link
├── man
└── viewers -> etc/viewers/ *link
from scc.
Could you provide an example of a file (2 would be better) that show how you would expect this to work. I want to see the file itself to determine how this should work.
from scc.
Here's a file, let me know if you need more, full of bash code.
https://github.com/nkh/ftl/blob/main/config/ftl/etc/core/ftl
As it is, it's not recognized.
If the extension is changed to .sh, it is recognized as a shell script
if "#!/bin/bash/ is at the beginning of the file, it is recognized as bash code
And now that I runt the test again, I realized that I was wrong.
file ftl -> ftl: Unicode text, UTF-8 text
mimetype ftl -> ftl: text/plain
but it's right with a shebang:
file ftl_shebang -> ftl_shebang: Bourne-Again shell script, Unicode text, UTF-8 text executable
mimetype ftl_shebang -> ftl_shebang: application/x-shellscript
I must have mixed files earlier, sorry.
But let's not lose a good opportunity, I know what those files are, I can cheat and have a list of files and create temporary files, with extension or shebang to give to scc. Or scc could accept a list, and in the best of worlds also generate a list of the files it checked and what types it thought they were.
I'd understand if you feel that the input file with file types (and the list of files/types) is not something you want to implement., I can write a workaround.
from scc.
The symlinks is one I want to know more about. I thought I took care of this. By default it should detect and ignore those, and you have to explicitly enable them using --include-symlinks
.
Possible to get a case that replicates it? Id be curious to know if either of these projects are affected too since they have the new file walking logic I want to move scc to
https://github.com/boyter/cs
https://github.com/boyter/dcd
from scc.
from scc.
Ideally id like a test case to replicate the issue. But I might be able to create one based on what you have mentioned above.
What OS are you on?
from scc.
Related Issues (20)
- Question: Use wildcards with excludes? HOT 1
- Unable to use multiple count-as flags HOT 5
- GNUmakefile is not recognized as Makefile HOT 1
- --exclude-dir doesn't exclude directories HOT 4
- Shields like style HOT 2
- Different Results on Windows and Linux HOT 5
- Cut new release? HOT 2
- Why CUDA files are not supported? HOT 2
- scc handle .gitignore are unexpected HOT 1
- error in Ubuntu 18.06: file or directory does not exist HOT 4
- sourcehut on sloc.xyz HOT 8
- Wrong language Complexity/Lines calculation when using -wide
- scc version 3.2.0 fails to compile with 32 bit golang toolchain in Windows HOT 3
- "Arvo" should be "Avro" HOT 1
- Add Templ Support
- Let badge exclude/include some folders HOT 4
- scc includes the .ignore file as part of the project counting HOT 4
- Feature Request Azure Bicep Support HOT 4
- RISCV assembly - can't count comments HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scc.