citation-style-language / styles

Official repository for Citation Style Language (CSL) citation styles.
https://citationstyles.org/
3.31k stars 3.77k forks source link

Test renamed-styles.json #1380

Open rmzelle opened 9 years ago

rmzelle commented 9 years ago

We should make sure that renamed-styles.json contains all style IDs that have been removed from the repository over time (and ideally, contain no style IDs that have never existed).

This requires comparisons between commits, so it might be easiest to periodically run a script over the commits from https://github.com/citation-style-language/styles-distribution, and keep track of which style IDs disappear over time. Integration in Travis would be nicer, but would be more complicated (although things can break pretty badly for users if we don't redirect styles).

rmzelle commented 9 years ago

@inukshuk, something to think about (although Sheldon takes priority :) ).

The easiest thing would probably be to check each commit for style deletions, and make sure those deletions are present in "renamed-styles.json". Ideally we would go back and cover the last few years as well, but that might be a bit tricky.

We're running into some trouble with GitHub/git WRT identifying deletions vs. renames (see https://github.com/citation-style-language/styles/pull/1526#discussion_r28647187 ), but I assume that won't be an issue if we implement this purely in Ruby.

rmzelle commented 9 years ago

Ideally we would go back and cover the last few years as well, but that might be a bit tricky.

That said, we already have some code to visit each commit made to https://github.com/citation-style-language/styles-distribution in https://github.com/cpina/csls-styles-report (to generate http://pinux.info/csls_counter/ ), so it might not be too hard to visit the last year or so, up to when we first started using the "styles-distribution" repo. We could walk through the regular "styles" repo as well, but I never could figure out how to properly exclude pre-merge commits from pull requests.

zuphilip commented 9 years ago

I guess, that moving an independent style into a dependent style or vice versa should not occur in this deleted/moved list. Correct?

zuphilip commented 9 years ago

Another question concerning the renaming file: The journal "Acta Theriologica" has changed its name to "Mammal Research" but they also changed ISSN/EISSN. Is this handled as a normal rename?

rmzelle commented 9 years ago

I guess, that moving an independent style into a dependent style or vice versa should not occur in this deleted/moved list. Correct?

The list only deals with style IDs, and those don't indicate whether a style is dependent or independent. So if a style file name stays the same, but it switches from being an independent styles to a dependent one (or vice versa), it doesn't need to be added to the list.

rmzelle commented 9 years ago

The journal "Acta Theriologica" has changed its name to "Mammal Research" but they also changed ISSN/EISSN. Is this handled as a normal rename?

Yes, since we want users who have the "Acta Theriologica" style installed to automatically switch to the "Mammal Research" style.

rmzelle commented 9 years ago

We should also add a test to make sure "renamed-styles.json" doesn't contain any style IDs for styles present in the repository.

bwiernik commented 2 months ago

@adam3smith Is this something we should pursue, or can I close?

adam3smith commented 2 months ago

I think this makes sense to keep for next CI update