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

Language statistics bar for repositories #4824

Closed
wants to merge 0 commits into from

Conversation

lafriks
Copy link
Member

@lafriks lafriks commented Aug 29, 2018

Fixes #2165

Implements language statistic calculation using https://github.com/src-d/enry library.

TODO:

  • Function to calculate language stats for git repository
  • Save language stats to database
  • Display language stats bar (cleanup depends on Implement getting HTML color code for languages src-d/enry#233)
  • Add support for linguist-vendored in .gitattributes file (this could be added later in other PR)
  • Async update language stats to database when repository changes
  • Initial language stats calculation for existing repositories

Screenshots:
image

image

image

@lafriks lafriks added type/feature Completely new functionality. Can only be merged if feature freeze is not active. pr/wip This PR is not ready for review type/changelog Adds the changelog for a new Gitea version labels Aug 29, 2018
@lafriks lafriks added this to the 1.7.0 milestone Aug 29, 2018
@lafriks lafriks force-pushed the feat/language_stats branch from 9ddb20a to 2d35342 Compare September 15, 2018 16:45
@adelowo adelowo mentioned this pull request Nov 16, 2018
@OmarAssadi OmarAssadi mentioned this pull request Nov 18, 2018
@adelowo
Copy link
Member

adelowo commented Nov 18, 2018

We are waiting on you 😉 😉

@bkcsoft bkcsoft added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Nov 18, 2018
@lunny
Copy link
Member

lunny commented Nov 19, 2018

should fix #2165

@techknowlogick techknowlogick modified the milestones: 1.7.0, 1.8.0 Dec 19, 2018
@stale
Copy link

stale bot commented Feb 17, 2019

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 months. Thank you for your contributions.

@stale stale bot added the issue/stale label Feb 17, 2019
@adelowo
Copy link
Member

adelowo commented Feb 17, 2019

😢😢😢😢

@stale stale bot removed the issue/stale label Feb 17, 2019
@MarkusAmshove
Copy link
Contributor

Can this support adding own languages via some kind of configuration, e.g. by extension-to-name mapping?

@davidak
Copy link

davidak commented Feb 17, 2019

@MarkusAmshove why not add new languages upstream?

@MarkusAmshove
Copy link
Contributor

MarkusAmshove commented Feb 18, 2019

Because they are internal self written languages, think about e.g. DSLs.
It's not that important, but would be neat :-)

Edit: I don't know how linguistic works, but if the gitattributes files allows to have "new" languages in them, and the go implementation copies that, it will work out of the box.

@kolaente
Copy link
Member

@MarkusAmshove I'd prefer it if this pr would be merged without your feature request and then a second one after this one with the feature. Makes it easier to review :)

@MarkusAmshove
Copy link
Contributor

No problemo :-)

@lafriks lafriks modified the milestones: 1.8.0, 1.9.0 Feb 19, 2019
@stale
Copy link

stale bot commented Apr 20, 2019

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 months. Thank you for your contributions.

@stale stale bot added the issue/stale label Apr 20, 2019
@lafriks
Copy link
Member Author

lafriks commented Apr 20, 2019

I will work on this a bit later :)

@stale stale bot removed the issue/stale label Apr 20, 2019
@techknowlogick techknowlogick modified the milestones: 1.9.0, 1.10.0 Jun 4, 2019
@lafriks lafriks force-pushed the feat/language_stats branch from 2d35342 to 4f41a29 Compare July 19, 2019 10:30
@lafriks lafriks force-pushed the feat/language_stats branch from faba95c to d1dcced Compare July 24, 2019 23:25
Language string `xorm:"VARCHAR(30) UNIQUE(s) INDEX NOT NULL"`
Percentage float32 `xorm:"NUMERIC(4,2) NOT NULL DEFAULT 0"`
Color string `xorm:"-"`
CreatedUnix util.TimeStamp `xorm:"INDEX CREATED"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to use code.gitea.io/gitea/modules/timeutil to reference TimeStamp

@codecov-io
Copy link

Codecov Report

Merging #4824 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #4824   +/-   ##
=======================================
  Coverage   41.59%   41.59%           
=======================================
  Files         480      480           
  Lines       64144    64144           
=======================================
  Hits        26680    26680           
  Misses      34004    34004           
  Partials     3460     3460

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 f1c4148...f1c4148. Read the comment docs.

@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
@delvh delvh removed the type/changelog Adds the changelog for a new Gitea version label Oct 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. pr/wip This PR is not ready for review type/feature Completely new functionality. Can only be merged if feature freeze is not active.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Languages Statusbar
10 participants