Skip to content

Commit

Permalink
2022 first update set (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
e3b0c442 authored Jul 21, 2022
1 parent 8689d71 commit 1076691
Show file tree
Hide file tree
Showing 7 changed files with 871 additions and 173 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
on:
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
- run: go run chart.go
- run: |
git config --global user.email "nick@e3b0c442.dev"
git config --global user.name "Nick Meyer"
git remote set-url origin https://${{ secrets.GITHUB_TOKEN }}@github.com/e3b0c442/keywords
git checkout -b new-main
git add README.md chart.png
git commit -m "[skip ci] Rebuild README.md and chart.png from chart.yaml update"
git checkout main
git merge new-main
git push origin main
4 changes: 3 additions & 1 deletion README.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
A list and count of keywords in programming languages. Based on work originally
compiled by [@leighmcculloch](https://github.com/leighmcculloch) and contributors.

_2020 update:_ I'm slowly working through this list and trying to standardize the meaning of "keyword" to be any word with special meaning in the language, as opposed to "reserved words" which cannot be used as identifiers. You may see some drastic changes depending on the language.
_2022 update (WIP):_ I took the latest versions of several popularity lists and am ensuring the top 10 in all three lists were on this list. There have been some pretty significant changes in the past couple of years, including the addition of some _soft_ or _contextual_ keywords in Python 3 and Java, increasing their keyword counts significantly.

In addition to the above, I migrated CI to GitHub Actions and am worknig to ensure multiple language versions with different keyword sets are represented.

![Languages by keyword](chart.png)

Expand Down
52 changes: 0 additions & 52 deletions azure-pipelines.yml

This file was deleted.

12 changes: 6 additions & 6 deletions chart.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"strconv"
"text/template"

"github.com/go-yaml/yaml"
"github.com/gosimple/slug"
"github.com/wcharczuk/go-chart"
"github.com/wcharczuk/go-chart/v2"
"gopkg.in/yaml.v3"
)

type Languages []Language
Expand Down Expand Up @@ -103,7 +103,7 @@ func main() {
//render and save the chart
chartData := make([]chart.Value, len(data))
for i := range data {
chartData[i] = chart.Value{Value: float64(len(data[i].Keywords)), Label: fmt.Sprintf("%s (%s)", data[i].Name, data[i].Version), Style: chart.StyleShow()}
chartData[i] = chart.Value{Value: float64(len(data[i].Keywords)), Label: fmt.Sprintf("%s (%s)", data[i].Name, data[i].Version), Style: chart.Shown()}
}

//make ticks
Expand All @@ -120,14 +120,14 @@ func main() {

barchart := chart.BarChart{
Title: "Programming languages by keyword count",
TitleStyle: chart.StyleShow(),
TitleStyle: chart.Shown(),
XAxis: chart.Style{
Show: true,
Hidden: false,
TextRotationDegrees: 90,
},
YAxis: chart.YAxis{
Name: "Keywords",
Style: chart.StyleShow(),
Style: chart.Shown(),
Ascending: true,
ValueFormatter: func(v interface{}) string {
return fmt.Sprintf("%d", int(v.(float64)))
Expand Down
Loading

0 comments on commit 1076691

Please sign in to comment.