Skip to content

Update according to Contributors library guidelines #30

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

Merged
merged 8 commits into from
Sep 15, 2020
Merged

Update according to Contributors library guidelines #30

merged 8 commits into from
Sep 15, 2020

Conversation

JordanMartinez
Copy link
Contributor

This pull request is part of an effort to update and standardize the Contributors libraries according to the Library Guidelines. Specifically, it:

  1. Adjusts the files and repository structure according to the repository structure section of the guidelines, which includes standard pr templates, issue templates, CI in GitHub Actions, automatic stale issue management, ensures the project uses Spago, and so on.
  2. Updates the README and documentation according to the documentation section of the guidelines. This is a first step towards ensuring Contributors libraries have adequate module documentation, READMEs, a docs directory, and tests (even if just usage examples) in a test directory.
  3. Updates labels where relevant to help folks better sift through issues on this library and get started contributing.

This PR is the groundwork for followup efforts to ensure contributor libraries are kept up-to-date, documented, tested, and accessible to users and new contributors.

@JordanMartinez
Copy link
Contributor Author

JordanMartinez commented Sep 14, 2020

Note: this currently fails because of the eslint rules.

npm run build

> @ build /home/jordan/Programming/Projects/purescript-nullable
> eslint src && spago build --purs-args '--censor-lib --strict'


/home/jordan/Programming/Projects/purescript-nullable/src/Data/Nullable.js
  6:10  error  Use '===' to compare with null       no-eq-null
  6:12  error  Expected '===' and instead saw '=='  eqeqeq

✖ 2 problems (2 errors, 0 warnings)

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ build: `eslint src && spago build --purs-args '--censor-lib --strict'`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/jordan/.npm/_logs/2020-09-14T03_24_37_868Z-debug.log

@thomashoneyman
Copy link
Contributor

Unless @hdgarrood or @garyb object, we can switch to use === for the comparisons (which will fix the linting error)

@garyb
Copy link
Member

garyb commented Sep 15, 2020

I think the use of == is intentional, as that will work for undefined as well.

@thomashoneyman
Copy link
Contributor

@garyb I've disabled those rules so the code can remain as-is.

@thomashoneyman thomashoneyman merged commit ee7c1dc into purescript-contrib:main Sep 15, 2020
@garyb
Copy link
Member

garyb commented Sep 15, 2020

I think that's why it was set to smart in the prior eslint config: https://eslint.org/docs/2.0.0/rules/eqeqeq#options

I'd forgotten about all this stuff, the JS knowledge is slowly coming back after a long time spent in pure-purescript-land 😆

@thomashoneyman
Copy link
Contributor

I'm not particularly familiar with eslint 😅 I implemented the standard config based on the most restrictive one I could find in -contrib, which was Aff. I would love to make improvements to it if you have any ideas (for example, switching to smart by default if you think that's the way to go). The template file is here:

https://github.com/purescript-contrib/governance/blob/main/updater/templates/js/.eslintrc.json

and it's pretty easy to drop a quick update to this library and other libraries using the same config.

@garyb
Copy link
Member

garyb commented Sep 15, 2020

I think going with the most restrictive one for the template makes sense. Null comparisons aren't all that common in FFI code I imagine (I don't think they should be at least!), so the fact it highlights things like this makes us rethink and reassess what's happening during these updates, which I think is a good thing.

@thomashoneyman
Copy link
Contributor

Would you prefer that we switch that rule to smart in this repository and remove the comments in the FFI file, or keep the change as-is?

@garyb
Copy link
Member

garyb commented Sep 15, 2020

Comment works for me, it reiterates that the choice is intentional.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants