Closed Righolt closed 6 years ago
Odd. I applied your change locally, and both appear in the list of languages for me.
Rust (rs)
SAS (sas)
Sass (sass,scss)
Scala (sc,scala)
Scheme (scm,ss)
Scons (csig,sconstruct,sconscript)
sed (sed)
Shell (sh)
SKILL (il)
Smarty Template (tpl)
Softbridge Basic (sbl)
SPDX (spdx)
Specman e (e)
Spice Netlist (ckt)
SQL (sql)
SRecode Template (srt)
Standard ML (SML) (sml)
Stata (do,ado)
SVG (svg)
Maybe a path issue? When you run scc are you doing so in the WSL or through CMD? If WSL (which I suspect you are using as you mention scc
not scc.exe
) after go build
you would need to run ./scc --languages
to ensure you get the new binary, or go install
to make it global (if you have this path setup).
I just tried the process both in WSL and CMD using your build without issue, so I am unable to replicate this. If you submit a PR im happy to do the generate for you though.
Actually I am faily confident it is just a path issue. Your PR indicates a change to processor/constants.go
which would only happen IF your go generate
worked with something new.
I am getting the right path to the updated binary, but it must somehow not get the updated processor/constants.go
... I will create a PR for this instead and then reclone the repo after.
Merged and regenerated the constants file. Should be included now if you pull from master.
scc.exe generates after go build
(after a fresh clone from the latest GitHub version), the languages do not show up. Running go generate
and go build
, the languages still do not show up (a new processor/constants.go
does appear).
I am using a direct path to scc.exe
(and there is no other scc file on my system). (Tried both in the command window and windows powershell through Visual Studio Code). Are there any dependencies I should be aware off or any other command besides those mentioned above I should run?
No the above should be all that is required. I am totally unable to replicate this.
See the below. I first removed a , from the languages.json file and tried to generate which produced the error. I then reverted that change, built as normal and ran scc.exe against the processor directory in the repository. I then removed Go from the list of languages in languages.json ran go generate then go build and then ran the same command to count the processor directory. Unable to recognise Go it returns nothing.
C:\Users\bboyter\Documents\Go\src\github.com\boyter\scc>go generate
failed to generate constants: failed to validate json in file 'languages.json': invalid character '"' after object key:value pair
exit status 1
main.go:9: running "go": exit status 1
C:\Users\bboyter\Documents\Go\src\github.com\boyter\scc>go build
C:\Users\bboyter\Documents\Go\src\github.com\boyter\scc>scc.exe processor
-------------------------------------------------------------------------------
Language Files Lines Code Comments Blanks Complexity
-------------------------------------------------------------------------------
Go 16 2928 2328 130 470 608
-------------------------------------------------------------------------------
Total 16 2928 2328 130 470 608
-------------------------------------------------------------------------------
Estimated Cost to Develop $65,603
Estimated Schedule Effort 5.449080 months
Estimated People Required 1.426129
-------------------------------------------------------------------------------
C:\Users\bboyter\Documents\Go\src\github.com\boyter\scc>go generate
C:\Users\bboyter\Documents\Go\src\github.com\boyter\scc>go build
C:\Users\bboyter\Documents\Go\src\github.com\boyter\scc>scc.exe processor
-------------------------------------------------------------------------------
Language Files Lines Code Comments Blanks Complexity
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
Total 0 0 0 0 0 0
-------------------------------------------------------------------------------
Estimated Cost to Develop $0
Estimated Schedule Effort 0.000000 months
Estimated People Required NaN
-------------------------------------------------------------------------------
C:\Users\bboyter\Documents\Go\src\github.com\boyter\scc>
Would you be able to try repeating the above steps for me please.
I will run this once I'm back at the computer I had this problem with (Tuesday probably).
Running go generate
does not throw an error after removing an a from the languages.json
file, but it generates the following empty processor\constants.go
package processor
const (
)
Then go build and run yields:
PS C:\Users\righoltc\Documents\GitHub\scc> go generate
PS C:\Users\righoltc\Documents\GitHub\scc> go build
PS C:\Users\righoltc\Documents\GitHub\scc> .\scc.exe --languages
ABAP (abap)
ActionScript (as)
Ada (ada,adb,ads,pad)
Agda (agda)
Alex (x)
AsciiDoc (adoc)
ASP (asa,asp)
ASP.NET (asax,ascx,asmx,aspx,master,sitemap,webinfo)
Assembly (s,asm)
ATS (dats)
Autoconf (in)
AutoHotKey (ahk)
AWK (awk)
BASH (bash)
Basic (bas)
Batch (bat,btm,cmd)
Boo (tex)
Brainfuck (bf)
C (c,ec,pgc)
C Header (h)
C Shell (csh)
C# (cs)
C++ (cc,cpp,cxx,c++,pcc)
C++ Header (hh,hpp,hxx,inl,ipp)
Cabal (cabal)
Cassius (cassius)
Ceylon (ceylon)
Clojure (clj)
ClojureScript (cljs)
CMake (cmake,cmakelists.txt)
COBOL (cob,cbl,ccp,cobol,cpy)
CoffeeScript (coffee)
Cogent (cogent)
ColdFusion (cfm)
ColdFusion CFScript (cfc)
Coq (v)
Crystal (cr)
CSS (css)
CSV (csv)
Cython (pyx)
D (d)
Dart (dart)
Device Tree (dts,dtsi)
Dhall (dhall)
Dockerfile (dockerfile,dockerignore)
Document Type Definition (dtd)
Elixir (ex,exs)
Elm (elm)
Emacs Dev Env (ede)
Emacs Lisp (el)
Erlang (erl,hrl)
Expect (exp)
Extensible Stylesheet Language Transformations (xslt)
F# (fs,fsi,fsx,fsscript)
F* (fst)
Fish (fish)
Forth (4th,forth,fr,frt,fth,f83,fb,fpm,e4,rx,ft)
FORTRAN Legacy (f,for,ftn,f77,pfo)
FORTRAN Modern (f03,f08,f90,f95)
Freemarker Template (ftl)
GDScript (gd)
Gherkin Specification (feature)
gitignore (.gitignore)
GLSL (vert,tesc,tese,geom,frag,comp)
Go (go)
Go Template (tmpl)
Gradle (gradle)
Groovy (groovy,grt,gtpl,gvy)
Hamlet (hamlet)
Handlebars (hbs,handlebars)
Happy (y,ly)
Haskell (hs)
Haxe (hx)
HEX (hex)
HTML (html,htm)
IDL (idl)
Idris (idr,lidr)
Intel HEX (ihex)
Isabelle (thy)
Jade (jade)
JAI (jai)
Java (java)
JavaScript (js,mjs)
JavaServer Pages (jsp)
Jenkins Buildfile (jenkinsfile)
JSON (json)
JSX (jsx)
Julia (jl)
Julius (julius)
Korn Shell (ksh)
Kotlin (kt,kts)
LaTeX (tex)
LD Script (lds)
Lean (lean,hlean)
LESS (less)
LEX (l)
License (license,licence,copying,copying3,unlicense,unlicence)
Lisp (lisp,lsp)
LOLCODE (lol,lols)
Lua (lua)
Lucius (lucius)
m4 (m4)
Macromedia eXtensible Markup Language (mxml)
Madlang (mad)
Makefile (makefile,mak,mk)
Markdown (md,markdown)
Meson ()
Modula3 (m3,mg,ig,i3)
Module-Definition (def)
MQL Header (mqh)
MQL4 (mq4)
MQL5 (mq5)
MSBuild (csproj,vbproj,fsproj,props,targets)
MUMPS (mps)
Mustache (mustache)
Nim (nim)
Nix (nix)
Objective C (m)
Objective C++ (mm)
OCaml (ml,mli)
Opalang (opa)
Org (org)
Oz (oz)
Pascal (pas)
Patch (patch)
Perl (pl,pm)
PHP (php)
PKGBUILD (pkgbuild)
Plain Text (text,txt)
Polly (polly)
Processing (pde)
Prolog (p,pro)
Properties File (properties)
Protocol Buffers (proto)
PSL Assertion (psl)
Puppet (pp)
PureScript (purs)
Python (py)
QCL (qcl)
QML (qml)
R (r)
Rakefile (rake)
Razor (cshtml)
Report Definition Language (rdl)
ReStructuredText (rst)
Robot Framework (robot)
Ruby (rb)
Ruby HTML (rhtml)
Rust (rs)
Sass (sass,scss)
Scala (sc,scala)
Scheme (scm,ss)
Scons (csig,sconstruct,sconscript)
sed (sed)
Shell (sh)
SKILL (il)
Smarty Template (tpl)
Softbridge Basic (sbl)
SPDX (spdx)
Specman e (e)
Spice Netlist (ckt)
SQL (sql)
SRecode Template (srt)
Standard ML (SML) (sml)
SVG (svg)
Swift (swift)
SystemVerilog (sv,svh)
TCL (tcl)
TeX (tex,sty)
Thrift (thrift)
TOML (toml)
TypeScript (ts,tsx)
TypeScript Typings (d.ts)
Unreal Script (uc,uci,upkg)
Ur/Web (ur,urs)
Ur/Web Project (urp)
Vala (vala)
Varnish Configuration (vcl)
Verilog (vg,vh)
Verilog Args File (irunargs,xrunargs)
VHDL (vhd)
Vim Script (vim)
Visual Basic (vb)
Vue (vue)
Wolfram (nb,wl)
XAML (xaml)
XCode Config (xcconfig)
XML (xml)
XML Schema (xsd)
Xtend (xtend)
YAML (yaml,yml)
Zsh (zsh)
PS C:\Users\righoltc\Documents\GitHub\scc>
For whatever reason the updated languages do not appear to be coming from processor\constants.go
.
Note that I have very limited Go experience, so I might be missing the obvious somewhere...
That is very odd... if constants.go
is empty then after you build you should get nothing in the language list. This suggests to me that your go build
is not working correctly for you, but oddly you get the exe file.
Do you have your GOPATH set correctly? It looks to me as though you have not set it up, and done both a go get
but then also cloned the directory. Because the cloned directory is outside the GOPATH it is looking at the old constants file as it refers to the full GOPATH.
You can verify your gopath on windows by trying echo %GOPATH%
on the command line. If you check I am willing to bet it is set to C:\Users\righoltc\go\
in which case you should open the following directory C:\Users\righoltc\go\src\github.com\boyter\scc
and try making your change in there.
Further reading about GOPATH and Go https://boyter.org/posts/how-to-start-go-project-2018/
Works great, thanks!
GOPATH is one of those annoying things. I should look into replacing the current dep with vgo to resolve this.
I tried to add language support for SAS and Stata, see diff.
I ran
go generate
andgo build
after, but these do not show up in the list when doingscc --languages
nor in the list when running the main version.Running go 1.11 on windows.
Any advice?