foray1010 / ignore-sync Goto Github PK
View Code? Open in Web Editor NEWa CLI tool to build and sync .*ignore files across files and repositories
License: MIT License
a CLI tool to build and sync .*ignore files across files and repositories
License: MIT License
Per https://git-scm.com/docs/gitignore#_pattern_format, if you have a .gitignore
pattern that does not contain a slash at the start or in the middle, then it matches recursively in any sub-directory relative the .gitignore
dirname:
Examples:
foo.js
matches ./foo.js
and ./bar/foo.js
foo/
matches ./foo/
and ./bar/foo/
/foo.js
only matches ./foo.js
foo/bar.js
only matches ./foo/bar.js
However, currently when using the [relative]
tag, globs are rewritten simply by prepending the dirname of the .gitignore
, e.g.:
foo.js
becomes relative/path/foo.js
This is incorrect, because it converts recursive patterns into non-recursive ones. I think patterns without a slash at the start or middle should instead be re-written using a **
:
foo.js
becomes relative/path/**/foo.js
foo/
becomes relative/path/**/foo/
/foo.js
becomes relative/path/foo.js
foo/bar.js
becomes relative/path/foo/bar.js
Currently, all GitHub sources are retrieved from the master branch.
I want to use the reference to other commits, branches, and tags.
e.g. [github/gitignore#main]
If this feature is okay to add, I will send a PR.
There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.
Error type: Cannot find preset's package (@foray1010/renovate-config)
6.16.0
to 6.17.0
.This version is covered by your current version range and after updating it in your project the build failed.
eslint-config-foray1010 is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
The new version differs by 3 commits.
0c071e3
chore(release): 6.17.0
63a1f49
feat: support typescript
150c84e
chore(package): update markdownlint-cli to version 0.13.0 (#48)
See the full diff
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
Hello, I noticed that [relative] was not being merged correctly for me on windows.
Here is a repo that should be able to show the issue: https://github.com/ajmchambers/ignore-sync-windows-issue
.testignore-sync
[inline]
inline-file.txt
[local]
local.txt
[relative]
__fixtures__/.testignore
The repo has copies of the resulting file on windows and the other on mac:
.testignore-result-win
############################################
# GENERATED BY IGNORE-SYNC, DO NOT EDIT!!! #
# https://github.com/foray1010/ignore-sync #
############################################
inline-file.txt
local-file.txt
.testignore-result-mac
############################################
# GENERATED BY IGNORE-SYNC, DO NOT EDIT!!! #
# https://github.com/foray1010/ignore-sync #
############################################
inline-file.txt
local-file.txt
__fixtures__/test_nested/level1.txt
__fixtures__/**/*_glob*.txt
I ran ignore-sync
's tests on windows and there were a couple failing tests:
The issue seems to be this line: https://github.com/foray1010/ignore-sync/blob/master/src/decodeIgnoreSyncFile.js#L29
const pattern = path.join('.', line)
// line has been normalized at this point
// if line is: '__fixtures__/test_glob*.txt'
// path.join uses the platform-specific separator, so pattern becomes: '__fixtures__\\test_glob*.txt'
If I force it to use the posix join it seems to fix the issue for me and the tests pass on windows and mac:
const pattern = path.posix.join('.', line)
I've got a pull request nearly ready to go.
rror: source `[]` not found before ignore pattern is found
at file:///C:/Users/babak/OneDrive/Documents/GitHub/babakfp.ir/node_modules/.pnpm/[email protected]/node_modules/ignore-sync/src/decodeIgnoreSyncFile.js:24:13
at Array.reduce (<anonymous>)
at decodeIgnoreSyncFile (file:///C:/Users/babak/OneDrive/Documents/GitHub/babakfp.ir/node_modules/.pnpm/[email protected]/node_modules/ignore-sync/src/decodeIgnoreSyncFile.js:11:53)
at async processIgnoreSyncFile (file:///C:/Users/babak/OneDrive/Documents/GitHub/babakfp.ir/node_modules/.pnpm/[email protected]/node_modules/ignore-sync/src/processIgnoreSyncFile.js:10:22)
at async Promise.all (index 0)
at async processDirectory (file:///C:/Users/babak/OneDrive/Documents/GitHub/babakfp.ir/node_modules/.pnpm/[email protected]/node_modules/ignore-sync/src/processDirectory.js:43:5)
at async startApp (file:///C:/Users/babak/OneDrive/Documents/GitHub/babakfp.ir/node_modules/.pnpm/[email protected]/node_modules/ignore-sync/src/app.js:25:5)
This issue was resolved after switching to v7.0.0
🚨 You need to enable Continuous Integration on all branches of this repository. 🚨
To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.
Since we didn’t receive a CI status on the greenkeeper/initial
branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.
If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/
.
Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please delete the greenkeeper/initial
branch in this repository, and then remove and re-add this repository to the Greenkeeper integration’s white list on Github. You'll find this list on your repo or organization’s settings page, under Installed GitHub Apps.
I want to use this package in a mono-repo, but I have run into a problem: when using the [local]
tag, the output code does not have the relative path appended. Example:
Input .prettierignore-sync
:
[local]
.gitignore
packages/benchmarks/.gitignore
Output .prettierignore
:
############################################
# GENERATED BY IGNORE-SYNC, DO NOT EDIT!!! #
# https://github.com/foray1010/ignore-sync #
############################################
node_modules/
lerna-debug.log
generated/
generator/build/
generator/generated/
But I expect this output:
############################################
# GENERATED BY IGNORE-SYNC, DO NOT EDIT!!! #
# https://github.com/foray1010/ignore-sync #
############################################
node_modules/
lerna-debug.log
packages/benchmarks/generated/
packages/benchmarks/generator/build/
packages/benchmarks/generator/generated/
Otherwise it gives me conflicts with other packages that I don't want to ignore.
Should be nice to allow global patterns for local
and relative
paths.
So we can change from:
[local]
.gitignore
[relative]
packages/benchmarks/.gitignore
packages/labs/.gitignore
packages/lit-element/.gitignore
packages/lit-html/.gitignore
packages/lit-ssr/.gitignore
packages/localize/.gitignore
packages/tests/.gitignore
packages/updating-element/.gitignore
To just:
[local]
.gitignore
[relative]
packages/**/.gitignore
My use case is to generate a .prettierignore
from a .gitignore
with some additional data. This works perfectly.
[local]
.gitignore
[inline]
package-lock.json
However I would like to take it one step ahead, where my .gitignore
is also generated by ignore-sync. I tried,
[local]
.gitignore-sync
[inline]
package-lock.json
but the above generates an invalid file
############################################
# GENERATED BY IGNORE-SYNC, DO NOT EDIT!!! #
# https://github.com/foray1010/ignore-sync #
############################################
[inline]
client/dist
[github/gitignore]
Node.gitignore
Global/macOS.gitignore
package-lock.json
For context, my .gitignore-sync
is
[inline]
client/dist
[github/gitignore]
Node.gitignore
Global/macOS.gitignore
Installed v6. Even with a simple .gitignore-sync
file, I get this error
TypeError: axios.get is not a function
at Object.getContentFile (<path-to-project>/node_modules/ignore-sync/src/utils/github.js:11:38)
at <path-to-project>/node_modules/ignore-sync/src/generateIgnoreFile.js:25:21
at Array.map (<anonymous>)
at githubSourceFetcher (<path-to-project>/node_modules/ignore-sync/src/generateIgnoreFile.js:24:16)
at <path-to-project>/node_modules/ramda/src/cond.js:64:30
at <path-to-project>/node_modules/ramda/src/internal/_arity.js:11:19
at _map (<path-to-project>/node_modules/ramda/src/internal/_map.js:7:19)
at map (<path-to-project>/node_modules/ramda/src/map.js:83:14)
at <path-to-project>/node_modules/ramda/src/internal/_dispatchable.js:50:15
at Object.f2 [as map] (<path-to-project>/node_modules/ramda/src/internal/_curry2.js:34:14)
File
[local]
client/dist
[github/gitignore]
Node.gitignore
Global/macOS.gitignore
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.