Commit Graph

33 Commits

Author SHA1 Message Date
Flakebi
3ad7ba46c5
vimPlugins: add vim and kakoune update script 2021-02-25 10:05:22 +01:00
Flakebi
2123e325c9
vimPlugins: make update.py generic over editor
Move the script to maintainers/scripts/pluginupdate.py.
Importing it from the vim and kakoune update scripts
is done in the commit afterwards to cleanup the diff.
2021-02-25 10:05:22 +01:00
ilian
1b2e5b707a vimPlugins: Ignore empty commits in update.py
The result of repo.index.add() contains the list of files that
have been added, even though they may be unchanged since the
latest commit. We only commit if at least one file has changed.
2021-02-14 17:16:23 +01:00
Cole Mickens
a957776ee2
vimplugins: update.py uses GITHUB_API_TOKEN if available 2020-07-07 02:24:03 -07:00
Lisa Ugray
e5707f2cb5 vimPlugins: Add meta.homepage
Allow determining the source from a nix-env query to disambiguate which
plugin you're using/about to use.
2020-04-24 17:01:03 -07:00
Rok Garbas
4f648dfda8
vimPlugins: added branch support for update.py script (#85102) 2020-04-12 23:05:00 +02:00
ryneeverett
0a2759483a vimPlugins: update auto-commiting based on review
- Use git.Repo(ROOT, search_parent_directories=True) to find nixpkgs
repo.
- Don't commit overrides.nix.
- Remove "-a" short argument.
- Remove "--commit" flag and commit by default.
- Improve help/error messages.
- Favor closure pattern over classes.Use a closure to wrap the update
function with state rather than a callable class.
- break NixpkgsRepo class into functions
- Optional None-type arguments
- Remove repo checks from update.py. Git is too flexible and permits too
many workflows for my attempt to replace documentation with code to work.
My goal would be to separate the `--add` functionality from the update
functionality in the near term and then there will be no reason for this
usage to create commits anyway.
2020-04-01 17:19:01 +00:00
ryneeverett
1c0f0de46c vimPlugins: normalize deprecation names
Parsing plugin lines in multiple places is hazardous and already manifested a
bug!
2020-04-01 14:30:46 +00:00
ryneeverett
1f32eb7987 vimPlugins: remove repetition from update.main
Adding some abstraction makes main() more readable which is important
since it's the main control flow of the script.
2020-04-01 14:30:39 +00:00
ryneeverett
f1ae95f6d3 vimPlugins: update.py --add <plugin> argument
- update.py's new --add argument replaces manual editing of
vim-plugin-names for basic use cases.
2020-04-01 14:30:39 +00:00
ryneeverett
042c3dc356 vimPlugins: automatically commit redirect updates
- When redirections are detected, rather than printing instructions,
update.py now creates two commits -- one with the plugin updates and
another with redirected plugin names updated to their new repos.
- Added a --allow-dirty flag so that one can run ./update.py --commit
with a dirty nixpkgs repository, which is necessary for development.
I wouldn't mind removing this before merging if it's not in our flag
budget but it's necessary scaffolding for now.
2020-04-01 14:30:33 +00:00
ryneeverett
df0db17740 vimPlugins: automatically commit update 2020-04-01 14:30:23 +00:00
ryneeverett
9546a64d46 vimPlugins: Add --proc flag to update script.
This is based on discussion in #83008 and replaces it.
2020-03-30 18:04:52 +00:00
ryneeverett
25fea4538e vimPlugins: Store deprecation date. 2020-03-27 16:19:54 +00:00
ryneeverett
7cc024b59e vimPlugins: Automatic rename deprecations
When an updated redirect results in a package name change, not just an
owner change, throw an error to warn users the package names has
changed.
2020-03-27 15:30:54 +00:00
ryneeverett
b886ad90e7 vimPlugins: Automatically sort vim-plugin-names.
Python's `sorted` method works a little differently than `sort` in the
handling of dashes.
2020-03-26 05:56:31 +00:00
ryneeverett
cffb6cb637 vimPlugins: Update redirects without flag.
Per review, the input file will now be rewritten automatically if
redirects are found.
2020-03-24 15:11:46 +00:00
ryneeverett
a9c9b0d40c vimPlugins: --update-redirects improvements.
In response to @timokau's review here are a couple changes:

- Decrease the fragility of the replacement code by normalizing
whitespace on each line.
- Throw an error when plugins are renamed rather than silently aliasing
to the new name.
2020-03-24 03:11:07 +00:00
ryneeverett
d4874a7ee6 vimPlugins: Automate redirect updates in update.py
Many of the plugins in vim-plugin-names are out of date and redirect to
their new github repos. This commit adds a flag to automatically update
these and defines a process for committing these updates into nixpkgs.
2020-03-22 04:04:50 +00:00
Timo Kaufmann
8c757f4dc9 vimPlugins: backoff on timeout in update.py
Updating vim-plugins recently started timing out regularly for me. It
may have to do with an ISP switch on my side, but I don't think that
should cause timeouts. I guess I'm probably not the only one
experiencing this, so in this comment I introduce exponential backoff.
Every request will be retried up to 3 times (3 seconds, 6 seconds, 12
seconds delay).
2019-11-19 21:10:32 +01:00
Timo Kaufmann
61c60bad22 vimPlugins: fix formatting and typing in update.py 2019-11-19 21:10:13 +01:00
Matthieu Coudron
3820ff9c8b vim update.py: allow different in and out files
...also adds an argparse cli parser.
2019-11-19 18:41:11 +09:00
Galen Abell
8eb8fa153e vimPlugins: Add alias support to update.py
Plugins in `plugin-list` can now optionally specify an alias name, to
avoid naming collisions if plugins have the same repo name. For example,
specifying `author/common-plugin as author-common-plugin` will use
`author-common-plugin` as the package name in `generated.nix`.
2019-11-06 10:55:51 -08:00
Tobias Mayer
134a061d93 Restrict vim update.py to generated.nix 2019-02-22 15:49:43 +01:00
Roman Volosatovs
f8ff164806 vimPlugins: Fix update.py, update (#53081) 2018-12-30 18:13:00 +01:00
Timo Kaufmann
96b6396101 vimUtils.buildVimPlugin: derive name from pname and version 2018-12-27 10:34:14 +01:00
Timo Kaufmann
b352318cd1 vimUtils: represent vim plugins as derivations
Vim plugins were previously represented as strings by default,
necessitating a `knownPlugins` set. Backwards compatibility is kept
(strings are still accepted), so vam plugins should continue to work.
2018-12-24 23:41:41 +01:00
Jörg Thalheim
6fdec2b3a4 vimPlugins: update.py also needs nix-prefetch-git 2018-09-20 08:42:46 +01:00
Jörg Thalheim
dec78a23d1 vimPlugins: only update generated.nix if all plugins were downloaded
https://github.com/NixOS/nixpkgs/pull/46728#discussion_r217915996
2018-09-16 16:59:41 +01:00
Jörg Thalheim
c4a621d4a6 vimPlugins: run update script in empty environment 2018-09-12 07:51:48 +01:00
Jörg Thalheim
ac415ca68e vimPlugins: do not pick up aliases from nixpkgs 2018-09-12 07:51:03 +01:00
Roman Volosatovs
8f4c5c72ac
vimPlugins: Fix update.py, add/update plugins 2018-09-10 21:41:04 +02:00
Jörg Thalheim
8ccdd29578 vim-plugins: add missing update.py
This file was accidentally not included in 953199fd82
2018-09-09 23:19:41 +01:00