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

Add super linter 1264 #1600

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
a58ceb5
add super linter
DanielFLopez Aug 10, 2021
eb58e3e
add exclude files
DanielFLopez Aug 10, 2021
e312594
add new line
DanielFLopez Aug 10, 2021
dfdaa9d
change exclude files format
DanielFLopez Aug 10, 2021
371c749
change checkout
DanielFLopez Aug 10, 2021
d93dd41
Update main.yml
DanielFLopez Aug 10, 2021
91eb1cb
add github token
DanielFLopez Aug 11, 2021
1a77077
rename var
DanielFLopez Aug 11, 2021
8663555
Merge branch 'add_super_linter_1264' of github.com:Monadical-SAS/scho…
DanielFLopez Aug 11, 2021
a8c86ad
add super linter vars
DanielFLopez Aug 11, 2021
9b41296
fix black errors
DanielFLopez Aug 11, 2021
1fd5dc1
fix errors between flake8 and black
DanielFLopez Aug 11, 2021
dffc9de
add ignored errors to flake8
DanielFLopez Aug 11, 2021
b2d8b59
fix black issues
DanielFLopez Aug 12, 2021
5dc8d70
add flake 8 file
DanielFLopez Aug 12, 2021
9ab1ea9
fix lint base.html
DanielFLopez Aug 12, 2021
1bd93ab
fix isort issue
DanielFLopez Aug 12, 2021
84dc9d8
add doc for request to wikidata function
DanielFLopez Aug 12, 2021
9d3096b
add black profile for isort
DanielFLopez Aug 12, 2021
5f34b51
deactivate pypy
DanielFLopez Aug 12, 2021
a3a1ea9
add ignore block for jscpd
DanielFLopez Aug 12, 2021
44405e0
fix jinja warnings
DanielFLopez Aug 12, 2021
dda69db
fix html formatting
DanielFLopez Aug 12, 2021
0f0e759
remove validations
DanielFLopez Aug 12, 2021
72b9c86
test with 3.9
DanielFLopez Aug 12, 2021
d9eefef
fix conflicts
DanielFLopez Aug 13, 2021
45fb3e1
merge with master
DanielFLopez Aug 17, 2021
ea60ecf
remove jscpd validation
DanielFLopez Aug 17, 2021
2f3a1e8
fix test arxiv
DanielFLopez Aug 30, 2021
f2d4907
Merge branch 'master' of github.com:WDscholia/scholia into add_super_…
DanielFLopez Aug 31, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/linters/.flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[flake8]
max-line-length = 79
ignore = E203,E501,W503,W504,W605
2 changes: 2 additions & 0 deletions .github/linters/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[tool.isort]
profile = "black"
19 changes: 16 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
name: Python package

on: [push]
on: [push, workflow_dispatch]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python: [2.7, 3.5, 3.7]
python: [3.7, 3.8, 3.9]

steps:
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v2
with:
persist-credentials: false
- name: Install lxml dependencies
run: sudo apt install libxml2-dev libxslt-dev
- name: Setup Python
Expand All @@ -26,3 +29,13 @@ jobs:
run: tox -e py # Run tox using the version of Python in `PATH`
- name: Run flake8
run: tox -e flake8
- name: Lint Code Base
uses: github/super-linter@v4
env:
FILTER_REGEX_EXCLUDE: .*(\.github|docs/|notebooks/|scholia/app/static/).*
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VALIDATE_PYTHON_MYPY: false
VALIDATE_HTML: false
VALIDATE_DOCKERFILE: false
VALIDATE_DOCKERFILE_HADOLINT: false
VALIDATE_JSCPD: false
2 changes: 1 addition & 1 deletion .gitpod.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM gitpod/workspace-full
FROM gitpod/workspace-base:latest

USER root

Expand Down
9 changes: 3 additions & 6 deletions runserver.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
from scholia.app import create_app

app = create_app(text_to_topic_q_text_enabled=False, third_parties_enabled=True)
app.config["APPLICATION_ROOT"] = "/"

app = create_app(
text_to_topic_q_text_enabled=False,
third_parties_enabled=True)
app.config['APPLICATION_ROOT'] = '/'

if __name__ == '__main__':
if __name__ == "__main__":
app.run(debug=True, port=8100)
3 changes: 2 additions & 1 deletion scholia/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Scholia."""

from ._version import get_versions
__version__ = get_versions()['version']

__version__ = get_versions()["version"]
del get_versions
20 changes: 10 additions & 10 deletions scholia/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,28 +37,28 @@ def main():

arguments = docopt(__doc__)

if arguments['--output']:
output_filename = arguments['--output']
if arguments["--output"]:
output_filename = arguments["--output"]
output_file = os.open(output_filename, os.O_RDWR | os.O_CREAT)
else:
# stdout
output_file = 1

output_encoding = 'utf-8'
output_encoding = "utf-8"

if arguments['arxiv-to-quickstatements']:
arxiv_id = arguments['<arxiv>']
if arguments["arxiv-to-quickstatements"]:
arxiv_id = arguments["<arxiv>"]
metadata = arxiv.get_metadata(arxiv_id)
quickstatements = arxiv.metadata_to_quickstatements(metadata)
write(output_file, quickstatements.encode(output_encoding))

elif arguments['orcid-to-q']:
qs = orcid_to_qs(arguments['<orcid>'])
elif arguments["orcid-to-q"]:
qs = orcid_to_qs(arguments["<orcid>"])
if len(qs) > 0:
print(qs[0])

elif arguments['string-to-type']:
type = string_to_type(arguments['<string>'])
elif arguments["string-to-type"]:
type = string_to_type(arguments["<string>"])
print(type)

elif arguments['run']:
Expand All @@ -71,5 +71,5 @@ def main():
app.run(debug=True, port=8100)


if __name__ == '__main__':
if __name__ == "__main__":
main()
Loading