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

bootstrap and fontawesome getting included in the language classification stats #4441

Closed
4 tasks done
Ferido07 opened this issue Feb 28, 2019 · 10 comments
Closed
4 tasks done

Comments

@Ferido07
Copy link
Contributor

Preliminary Steps

Please confirm you have...

Problem Description

URL of the affected repository: https://github.com/Ferido07/oms

Last modified on: 2019-02-28

Expected language: Java

Detected language: CSS and Javascript

Linguist is not ignoring bootstrap and font awesome files under

  • /src/main/resources/static/vendor/bootstrap/css/
  • /src/main/resources/static/vendor/bootstrap/js/
  • /src/main/resources/static/vendor/fontawesome/css/

I have checked the vendor.yml and I see it does not match the criteria for bootstrap nor font-awesome and I have tried to add a different directory structure for bootstrap and font-awesome, and also added directory structure for vendor files in maven based java projects. I created a pull request hope it helps.

@lildude
Copy link
Member

lildude commented Feb 28, 2019

Linguist is not ignoring bootstrap and font awesome files under

It most certainly is. Those aren't the only CSS and Javascript files in your repo. These are the ones Linguist is detecting and reporting on:

$ github-linguist oms --breakdown
53.98%  Java
35.51%  HTML
9.64%   JavaScript
0.87%   CSS

Java:
src/main/java/com/kft/OmsApplication.java
[... truncated for brevity ...]

CSS:
src/main/resources/static/css/autocomplete.css
src/main/resources/static/css/offence-code-list.css
src/main/resources/static/css/offence-form.css

JavaScript:
src/main/resources/static/js/layout.js
src/main/resources/static/js/offence-form.js
src/main/resources/static/js/offence-list.js
src/main/resources/static/js/offence-show.js

HTML:
src/main/resources/templates/association/list.html
src/main/resources/templates/driver/list.html
src/main/resources/templates/layout.html
src/main/resources/templates/offence-code/list.html
src/main/resources/templates/offence/form.html
src/main/resources/templates/offence/list.html
src/main/resources/templates/offence/show.html
src/main/resources/templates/offence/status.html
src/main/resources/templates/offender/offence-list.html
src/main/resources/templates/vehicle/list.html
$

As you can see, none of them are in bootstrap or fontawesome, both of which are correctly ignored thanks to:

https://github.com/github/linguist/blob/e4560984058b4726010ca4b8f03ed9d0f8f464db/lib/linguist/vendor.yml#L89-L93

@Ferido07
Copy link
Contributor Author

But that is not what I'm looking at I have attached the screenshots below.
And I have recently added a .gitignore for linguist-vendored after posting the issue.

screenshot 253

screenshot 255

screenshot 254

@lildude
Copy link
Member

lildude commented Feb 28, 2019

But that is not what I'm looking at

Ah, ok. We're looking at two different things here.

First off, it does indeed appear the bootstrap and fontawesome paths were being included in the initial language stats - I completely missed you'd already added an override when I looked at your repo. Your language bar hasn't updated to reflect this as there is a known limitation in that .gitattributes changes don't currently kick off a re-analysis job, and you've not made any changes since adding the overrides. As soon as you push a change, you should see your language bar updated.

As for the two different things... your second and third screenshots are showing what Search has indexed (ie all of the files in your repo) and displaying the results of that indexing, independently from what Linguist has done. Linguist attributes in .gitattributes will have no influence over Search as you can see in the copy (not fork) I make of your repo at https://github.com/lildude/oms:

I've got the updated language bar:

langbar

... and the search results continue to show all CSS files, including the bootstrap and fontawesome files - https://github.com/lildude/oms/search?l=CSS

@Ferido07
Copy link
Contributor Author

Ok I've got your point that the search and the stats are independent but it seems like the search shows the breakdown of the stats since I reach the page through the stats. My bad didn't know.

And I have read in the documentation of linguist that it starts a low priority job when pushing updates and so I wasn't expecting it to update soon. But now I know that adding .gitignore doesn't even start the job so then I wont be expecting a change until after I push an update and then wait for the stat breakdown job of linguist to complete.

Did I get it right?

@lildude
Copy link
Member

lildude commented Feb 28, 2019

Ok I've got your point that the search and the stats are independent but it seems like the search shows the breakdown of the stats since I reach the page through the stats. My bad didn't know.

Yeah, this is a little confusing and definitely not your fault.

But now I know that adding .gitignore doesn't even start the job so then I wont be expecting a change until after I push an update and then wait for the stat breakdown job of linguist to complete.

Did I get it right?

Yup.

@Ferido07
Copy link
Contributor Author

Ok thanks.

@pchaigno
Copy link
Contributor

I think we should clarify that sentence in the README:

When you push changes to a repository on GitHub.com, a low priority background job is enqueued to analyze your repository as explained above.

As @Ferido07 noted, it's misleading. Some changes do not trigger the background job.

@Ferido07 Do you want to take a stab at it?

@Ferido07
Copy link
Contributor Author

Ferido07 commented Mar 6, 2019

But now I know that adding .gitignore doesn't even start the job so then I wont be expecting a change >>until after I push an update and then wait for the stat breakdown job of linguist to complete.

Did I get it right?

Yup

@lildude But now the stats have updated to match those you got on your copy without me pushing any new commits.

@Ferido07
Copy link
Contributor Author

Ferido07 commented Mar 6, 2019

@pchaigno I'll try my best once I understand when exactly the updates are made. Because if you see in my previous comment I just observed another unexpected behavior contrary to what @lildude said.

@lildude
Copy link
Member

lildude commented Mar 6, 2019

@lildude But now the stats have updated to match those you got on your copy without me pushing any new commits.

Ah, that'll be due to some caching changes that happened this week on GitHub.com. This is most definitely not a normal or regular occurrence... you're just lucky we happened to be working on the cache this week 😁

@github-linguist github-linguist locked as resolved and limited conversation to collaborators Jun 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants